Created
October 16, 2018 23:32
-
-
Save ikurni/fc134cd967e1c417657491688011e4d9 to your computer and use it in GitHub Desktop.
OCP hosts preparation scripts - docker 1.13 above
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: clients | |
tasks: | |
- name: Install additional packages needed | |
yum: | |
name: "{{ item }}" | |
state: latest | |
with_items: | |
- wget | |
- git | |
- net-tools | |
- bind-utils | |
- iptables-services | |
- bridge-utils | |
- bash-completion | |
- kexec-tools | |
- sos | |
- psacct | |
- atomic-openshift-utils | |
- docker | |
- atomic-openshift-excluder | |
- atomic-openshift-docker-excluder | |
- name: Run Openshift Excluder | |
shell: atomic-openshift-excluder unexclude | |
- name: Check sdb availability | |
stat: | |
path: /dev/sdb | |
register: vdbavail | |
- name: Change docker storage config | |
lineinfile: | |
path: /etc/sysconfig/docker-storage-setup | |
regexp: '^STORAGE_DRIVER' | |
line: '#STORAGE_DRIVER=overlay2' | |
- name: Change docker storage config | |
lineinfile: | |
path: /etc/sysconfig/docker-storage-setup | |
regexp: '^CONTAINER_THINPOOL' | |
line: '#CONTAINER_THINPOOL=docker-pool' | |
- name: Add additional line in docker storage config | |
lineinfile: | |
path: /etc/sysconfig/docker-storage-setup | |
line: 'DEVS=/dev/sdb' | |
- name: Add additional line in docker storage config | |
lineinfile: | |
path: /etc/sysconfig/docker-storage-setup | |
line: 'VG=docker-vg' | |
- name: Run Docker storage setup | |
shell: 'docker-storage-setup' | |
when: vdbavail.stat.exists == true | |
- name: Enable and Start docker service | |
systemd: | |
name: docker | |
enabled: yes | |
state: started | |
- name: Stop firewalld service | |
systemd: | |
name: firewalld | |
state: stopped | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment