Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
110 lines (92 sloc) 2.3 KB
---
# file: prep.yml
# @dlbewley
# Playbook to prep OpenShift Enterprise hosts for installation. Run this before
# the openshift-ansible byo playbook.
- hosts: all
#-----
vars:
#-----
- docker_storage_setup: |
DEVS=/dev/vdb
VG=docker-vg
tasks:
#-----
- name: Remove NetworkManager
yum:
name: NetworkManager
state: absent
- name: Install prereqs
yum:
name: "{{ item }}"
state: present
with_items:
- atomic-openshift-utils
- bind-utils
- bridge-utils
- docker
- gcc
- git
- iptables-services
- net-tools
- ntp
- openssh-clients
- python
- python-virtualenv
- wget
- name: Install life enhancers on master
yum:
name: "{{ item }}"
state: present
with_items:
- bash-completion
- deltarpm
- etcd
- tmux
- vim-enhanced
when: "'masters' in group_names"
- name: Enable NTPd
service:
name: ntpd
enabled: yes
state: started
- name: Make journald logs persistent to assist troubleshooting
file:
name: /var/log/journal
state: directory
notify: restart journald
# openshift-ansible/roles/openshift_node/tasks/storage_plugins/nfs.yml
# enables sebool 'virt_use_nfs', but i still had to use 'all_squash' rather
# than 'root_squash' on the NFS export.
# Will the following fix that? Not yet tested.
- name: OpenShift use nfs files
seboolean:
name: openshift_use_nfs
state: yes
persistent: yes
when: "'nodes' in group_names"
# https://docs.openshift.com/enterprise/3.1/admin_guide/overcommit.html#disable-swap-memory
- name: Remove swaps from fstab
lineinfile:
dest: /etc/fstab
regexp: '^/[\S]+\s+swap\s+swap'
state: absent
notify: disable swap
when: "'nodes' in group_names"
- name: Setup docker storage config
copy:
content: "{{ docker_storage_setup }}"
dest: /etc/sysconfig/docker-storage-setup
notify: docker storage setup
when: "'nodes' in group_names"
handlers:
#-------
- name: disable swap
command: swapoff --all
ignore_errors: yes
- name: restart journald
service:
name: systemd-journald
state: restarted
- name: docker storage setup
command: docker-storage-setup