Skip to content

Instantly share code, notes, and snippets.

@nccurry
nccurry / renew_dhcp_lease.sh
Created February 6, 2022 15:33
Renew DHCP Lease nmcli
nmcli con
nmcli con down id 'Wired connection 1'
nmcli con up id 'Wired connection 1'
# Attempt to update device with changes to the currently active
# connection made since it was last applied and then try it again
nmcli device reapply 'Wired connection 1'
@nccurry
nccurry / manifest.yml
Created April 13, 2021 12:37
OpenShift Smoke Test Sample Application
apiVersion: v1
kind: List
items:
- kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: httpd-www
namespace: openshift-smoke-test
spec:
@nccurry
nccurry / gist:16deb8a478f22a4d00ab2cddfd7fb455
Created February 4, 2020 16:28
Delete all trident pvcs with go templatews
- name: Get a list of all pvcs using trident
vars:
# !unsafe tag tells ansible not to interpret any special characters
go_template: !unsafe '{{ range .items }}{{ if eq .spec.storageClassName "trident" }}{{ "- name: " }}{{ .metadata.name }} {{ "\n namespace: " }}{{ .metadata.namespace }}{{ "\n" }}{{ end }}{{ end }}'
shell: "oc get pvc
--all-namespaces
-o go-template='{{ go_template }}'"
register: get_pvcs
changed_when: false
@nccurry
nccurry / ocp4-chk-upgrade-channel
Created January 24, 2020 13:28 — forked from ryran/ocp4-chk-upgrade-channel
OCP4: check upgrade channel for a particular release
#!/bin/bash
# ocp4-chk-upgrade-channel v0.0.3 last mod 2020/01/23
# Copyright 2020 Ryan Sawhill Aroha <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@nccurry
nccurry / ocp4-download-clients
Created January 24, 2020 13:28 — forked from ryran/ocp4-download-clients
OCP4: Validate release available and download oc/openshift-install clients
#!/bin/bash
# ocp4-download-clients v0.2.0 last mod 2020/01/23
# Copyright 2020 Ryan Sawhill Aroha <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@nccurry
nccurry / Automating OCP on VMWARE without DHCP using ipxe
Created January 21, 2020 15:02 — forked from ralvares/Automating OCP on VMWARE without DHCP using ipxe
Using ipxe media to install rhcos without DHCP Server.
PS: This method works just with BIOS
#Install packages#
sudo yum install git xz-devel -y
sudo yum groupinstall "Development tools" -y
#Download ipxe
git clone https://github.com/ipxe/ipxe/
cd ipxe/src
@nccurry
nccurry / ansible-reboot.yml
Created March 10, 2019 16:10
Reboot ansible host after package update
- name: Update/reboot host
gather_facts: false
become: true
tasks:
- name: Update system packages
yum:
name: '*'
state: latest
register: yum_update
retries: 5
@nccurry
nccurry / insert-htpasswd-identity-ocp.yaml
Last active October 6, 2017 15:34
Insert htpasswd identity provider on all OpenShift master hosts
---
# ansible-playbook insert-htpasswd-identity-ocp.yaml --extra-vars '{"master_host_group":"masters","users":["user1","user2"],"password":"password"}'
- hosts: localhost
connection: local
become: false
tasks:
- name: Add users to htpasswd file
htpasswd:
create: yes
state: present