Skip to content

Instantly share code, notes, and snippets.

@xphyr
Created April 5, 2019 23:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xphyr/705b7f3e718f6bc68b8e75da9e6913ba to your computer and use it in GitHub Desktop.
Save xphyr/705b7f3e718f6bc68b8e75da9e6913ba to your computer and use it in GitHub Desktop.
---
- name: Prep OS
hosts: all
tasks:
- name: Update OS
yum:
update_cache: yes
name: "*"
state: latest
register: yum_update
- name: Install Prereqs
yum:
name: "wget,git,net-tools,bind-utils,yum-utils,iptables-services,bridge-utils,bash-completion,kexec-tools,sos,psacct"
state: latest
- name: Install Epel
yum:
name: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm"
state: present
- name: Disable Epel Repo
replace:
path: /etc/yum.repos.d/epel.repo
regexp: "^enabled=1"
replace: "enabled=0"
backup: no
- name: Enable Network Manager
replace:
path: /etc/sysconfig/network-scripts/ifcfg-eth0
regexp: "^NM_CONTROLLED=no"
replace: "NM_CONTROLLED=true"
backup: no
register: nm_update
- name: Reboot node {{ inventory_hostname }}
reboot:
when: yum_update.changed == true or nm_update.changed == true
register: reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment