diff --git a/adhoc-provision-node.yml b/adhoc-provision-node.yml index f580079..47fdfb8 100644 --- a/adhoc-provision-node.yml +++ b/adhoc-provision-node.yml @@ -16,9 +16,14 @@ # # Call this adhoc playbook with --limit to deploy host[s]/group # -- hosts: all +- hosts: "{{ init_hosts }}" become: true gather_facts: false + vars_prompt: + - name: "init_hosts" + prompt: "[WARNING] Nodes to be fully wiped/reinstalled with CentOS => " + private: no + tasks: - name: == Hardware provisioning == Creating kickstart to provision VM[s] diff --git a/requirements-dev.yml b/requirements-dev.yml index 537dfaf..928615a 100644 --- a/requirements-dev.yml +++ b/requirements-dev.yml @@ -32,6 +32,9 @@ - src: https://github.com/CentOS/ansible-role-httpd name: httpd version: staging +- src: https://github.com/CentOS/ansible-role-httpd-compose + name: httpd-compose + version: staging - src: https://github.com/CentOS/ansible-role-httpd-feeds name: httpd-feeds version: staging diff --git a/requirements-production.yml b/requirements-production.yml index 2192a1d..5f6157f 100644 --- a/requirements-production.yml +++ b/requirements-production.yml @@ -21,6 +21,8 @@ name: haproxy - src: https://github.com/CentOS/ansible-role-httpd name: httpd +- src: https://github.com/CentOS/ansible-role-httpd-compose + name: httpd-compose - src: https://github.com/CentOS/ansible-role-httpd-feeds name: httpd-feeds - src: https://github.com/CentOS/ansible-role-ipsilon diff --git a/requirements-staging.yml b/requirements-staging.yml index 537dfaf..928615a 100644 --- a/requirements-staging.yml +++ b/requirements-staging.yml @@ -32,6 +32,9 @@ - src: https://github.com/CentOS/ansible-role-httpd name: httpd version: staging +- src: https://github.com/CentOS/ansible-role-httpd-compose + name: httpd-compose + version: staging - src: https://github.com/CentOS/ansible-role-httpd-feeds name: httpd-feeds version: staging diff --git a/role-all.yml b/role-all.yml index 5adfe34..98f4ed4 100644 --- a/role-all.yml +++ b/role-all.yml @@ -9,6 +9,7 @@ - import_playbook: role-gitea.yml - import_playbook: role-haproxy.yml - import_playbook: role-httpd.yml +- import_playbook: role-httpd-compose.yml - import_playbook: role-httpd-feeds.yml - import_playbook: role-ipsilon.yml - import_playbook: role-iptables.yml diff --git a/role-httpd-compose.yml b/role-httpd-compose.yml new file mode 100644 index 0000000..02c3132 --- /dev/null +++ b/role-httpd-compose.yml @@ -0,0 +1,24 @@ +--- +- hosts: hostgroup-role-httpd-compose + become: True + pre_tasks: + - name: Checking if no-ansible file is there + stat: + path: /etc/no-ansible + register: no_ansible + + - name: Verifying if we can run ansible or not + assert: + that: + - "not no_ansible.stat.exists" + msg: "/etc/no-ansible file exists so skipping ansible run on this node" + + roles: + - httpd-compose + + post_tasks: + - name: Touching ansible-run (monitored by Zabbix) + file: + path: /var/log/ansible.run + state: touch + diff --git a/role-httpd-www-staging.yml b/role-httpd-www-staging.yml index 2d737a3..05e8399 100644 --- a/role-httpd-www-staging.yml +++ b/role-httpd-www-staging.yml @@ -19,6 +19,7 @@ roles: - httpd + tasks: - import_role: name: httpd diff --git a/templates/pxeboot.j2 b/templates/pxeboot.j2 index 5d96ea1..a5c2763 100644 --- a/templates/pxeboot.j2 +++ b/templates/pxeboot.j2 @@ -11,9 +11,9 @@ LABEL local LABEL {{ inventory_hostname}}-deploy MENU LABEL CentOS {{ centos_version }} {{ arch }}- Kickstart for {{ inventory_hostname }} - kernel CentOS//{{ centos_version }}/{{ arch }}/vmlinuz + kernel boot/centos/{{ centos_version }}/{{ arch }}/vmlinuz {% if centos_version == 7 or centos_version == 8 or centos_version == '8-stream' -%} - append initrd=CentOS/{{ centos_version }}/{{ arch }}/initrd.img net.ifnames=0 biosdevname=0 ip={{ pxe_bootdev }}:dhcp inst.ks={{ ks_url }}/{{ inventory_hostname }}-ks.cfg + append initrd=boot/centos/{{ centos_version }}/{{ arch }}/initrd.img net.ifnames=0 biosdevname=0 ip={{ pxe_bootdev }}:dhcp inst.ks={{ ks_url }}/{{ inventory_hostname }}-ks.cfg {% else -%} - append initrd=CentOS/{{ centos_version }}/{{ arch }}/initrd.img ksdevice=eth0 ip=dhcp ks={{ ks_url }}/{{ inventory_hostname }}-ks.cfg + append initrd=boot/centos/{{ centos_version }}/{{ arch }}/initrd.img ksdevice=eth0 ip=dhcp ks={{ ks_url }}/{{ inventory_hostname }}-ks.cfg {% endif %}