Skip to content

Commit

Permalink
Added new roles and modified pxeboot template to reflect changes in b…
Browse files Browse the repository at this point in the history
…oot-server role

Signed-off-by: Fabian Arrotin <[email protected]>
  • Loading branch information
arrfab committed Jul 9, 2020
1 parent e5328c7 commit 277c18b
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 4 deletions.
7 changes: 6 additions & 1 deletion adhoc-provision-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
3 changes: 3 additions & 0 deletions requirements-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions requirements-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions requirements-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions role-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 24 additions & 0 deletions role-httpd-compose.yml
Original file line number Diff line number Diff line change
@@ -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

1 change: 1 addition & 0 deletions role-httpd-www-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

roles:
- httpd

tasks:
- import_role:
name: httpd
Expand Down
6 changes: 3 additions & 3 deletions templates/pxeboot.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

0 comments on commit 277c18b

Please sign in to comment.