This repository has been archived by the owner on Aug 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
switch_to_aws.yml
40 lines (36 loc) · 1.57 KB
/
switch_to_aws.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
36
37
38
39
40
---
# #####################################################################
# Switches the MOADSD-NG Environment to Amazon AWS
# #####################################################################
- name: Switches the MOADSD-NG Environment to Amazon AWS
hosts: localhost
gather_facts: no
connection: local
tasks:
- name: Include vars
include: site_vars.yml
- name: Find yml files in group_vars
find:
paths: "./group_vars"
patterns: "*.yml"
register: files_to_delete
- name: Delete yml files in group_vars
file:
path: "{{ item.path }}"
state: absent
with_items: "{{ files_to_delete.files }}"
- name: Configure group_vars
delegate_to: 127.0.0.1
copy:
dest: "{{ item }}"
content: |
{% raw %}ansible_ssh_common_args: -o ProxyCommand="ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -W %h:%p ansible@{{ groups['moadsd_ng_jumphost_instance_public'][0] }}"{% endraw %}
force: yes
loop:
- "./group_vars/tag_role_{{ kubernetes_master_tags | regex_replace('-', '_') }}.yml"
- "./group_vars/tag_role_{{ kubernetes_worker_tags | regex_replace('-', '_') }}.yml"
- "./group_vars/tag_role_{{ openshift_tags | regex_replace('-', '_') }}.yml"
- "./group_vars/tag_role_{{ postgresql_tags | regex_replace('-', '_') }}.yml"
- "./group_vars/tag_role_{{ deepsecurity_tags | regex_replace('-', '_') }}.yml"
- "./group_vars/tag_role_{{ linuxep_tags | regex_replace('-', '_') }}.yml"
when: site_deploy_jumphost == True