jbride
2018-06-06 87ecf8e232e0bab91f9906a05b9efc0fd4f79e7e
commit | author | age
3057c1 1 ---
6f07a3 2 - name: Step 003 - Create env key
S 3   hosts: localhost
4   connection: local
5   gather_facts: false
6   become: false
7   vars_files:
8     - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml"
9     - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml"
10   tags:
11     - step003
12     - generate_env_keys
13   tasks:
14     - name: Generate SSH keys
15       shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" -q -N ""
16       args:
17         creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}"
18       when: set_env_authorized_key
19
20 # Cloudformation template or equivalent should tag all hosts with Project:{{ env_type }}-{{ guid }}
21
22 - name: Configure all hosts with Repositories, Common Files and Set environment key
df0b13 23   hosts:
S 24     - all:!windows
6f07a3 25   become: true
S 26   gather_facts: False
27   vars_files:
28     - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml"
29     - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml"
30   tags:
31     - step004
32     - common_tasks
33   roles:
34     - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' }
35     - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' }
36     - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' }
37
38 - name: Configuring Bastion Hosts
df0b13 39   hosts: bastions
6f07a3 40   become: true
S 41   vars_files:
42     - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml"
43     - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml"
44   roles:
42a979 45     -  role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion"
GC 46        when: install_bastion|bool
6f07a3 47   tags:
S 48     - step004
49     - bastion_tasks
50
51 - name: PreSoftware flight-check
52   hosts: localhost
53   connection: local
54   gather_facts: false
55   become: false
56   vars_files:
57     - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml"
58     - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml"
59   tags:
60     - flight_check
61   tasks:
62     - debug:
63         msg: "Pre-Software checks completed successfully"