-
Notifications
You must be signed in to change notification settings - Fork 20
/
adhoc-init-node.yml
36 lines (31 loc) · 1.11 KB
/
adhoc-init-node.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
- hosts: all
vars_prompt:
- name: "warning_message"
prompt: "[WARNING] : have you called this script with --limit to apply only to some nodes/groups ? CTRL+C if not the case"
private: no
become: True
gather_facts: True
tasks:
- block:
- name: Find our public ip
uri:
url: http://ipv4.icanhazip.com
return_content: yes
register: public_ip
- set_fact:
pub_ip: "{{ public_ip.content | replace('\n', '') }}"
- name: Granting IP access in firewall for the new nodes to infra nodes
shell: "/usr/local/bin/authorize_ip_host {{ pub_ip }}"
delegate_to: "{{ item }}"
with_items: "{{ infra_admin_hosts }}"
when:
- infra_admin_hosts is defined
- dnf_use_proxy is defined and not dnf_use_proxy
- import_playbook: adhoc-sshd_sign_host_key.yml
when: ssh_ca_sign is defined and ssh_ca_sign
- import_playbook: adhoc-host-getvars.yml
# Just the new baseline everywhere
- import_playbook: role-baseline.yml
# And now the roles based on inventory match / group membership
- import_playbook: role-all.yml