Update configuration playbooks

This commit is contained in:
Ethan Paul 2020-03-21 13:26:29 -04:00
parent 01c882d585
commit fd2989cd66
No known key found for this signature in database
GPG Key ID: D0E2CBF1245E92BF
3 changed files with 63 additions and 34 deletions

View File

@ -5,6 +5,17 @@
hosts: servers
roles:
- role: docker
tasks:
- name: Disable firewall on internal interface
become: true
firewalld:
state: enabled
service: docker-swarm
permanent: true
immediate: true
- name: Configure swarm master
hosts: jupiter
tasks:
- name: Configure portainer volume
docker_volume:
@ -22,12 +33,30 @@
- /var/run/docker.sock:/var/run/docker.sock
- portainer:/data
- name: Configure swarm master
hosts:
- jupiter
- vigil-nox
tasks:
- name: Initialize swarm
docker_swarm:
name: omni
advertise_addr: "{{ omni_networking.eno2.address[0] }}"
state: present
advertise_addr: "{{ omni_docker_swarm_iface }}"
- name: Set swarm master to DRAIN
docker_node:
hostname: "{{ ansible_host }}"
availability: drain
- name: Configure swarm nodes
hosts:
- remus
- romulus
tags: docker-nodes
tasks:
- name: Fetch docker swarm information
delegate_to: jupiter
docker_swarm_info:
register: _swarm_info
- name: Join workers to swarm
docker_swarm:
state: join
remote_addrs: ["jupiter.svr.local"]
join_token: "{{ _swarm_info.swarm_facts.JoinTokens.Worker }}"
advertise_addr: "{{ omni_docker_swarm_iface }}"

View File

@ -1,26 +0,0 @@
---
- import_playbook: meta.yml
- name: Update system
hosts: all
pre_tasks:
- import_tasks: tasks/centos-8-kernelplus.yml
tags: kernel
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "8"
roles:
- role: packages
vars:
omni_pkg_update: true
omni_pkg_clean: true
- role: sshd
vars:
omni_restart_services: true
- role: common_env
tasks:
- name: Enable cockpit
become: true
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "8"
systemd:
name: cockpit
enabled: true
state: started

View File

@ -1,6 +1,32 @@
---
- import_playbook: configure-system.yml
- import_playbook: meta.yml
- name: Configure system settings
hosts: all
pre_tasks:
- import_tasks: tasks/centos-8-kernelplus.yml
tags: kernel
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "8"
roles:
- role: packages
vars:
omni_pkg_clean: true
- role: sshd
vars:
omni_restart_services: true
tasks:
- name: Enable cockpit
become: true
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "8"
systemd:
name: cockpit
enabled: true
state: started
- import_playbook: configure-auth.yml
- import_playbook: configure-env.yml
- import_playbook: configure-network.yml
- import_playbook: configure-docker.yml