Skip to content

Commit

Permalink
Multi-region
Browse files Browse the repository at this point in the history
  • Loading branch information
UNiXMIT committed Mar 8, 2024
1 parent ef8f381 commit e10049e
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 33 deletions.
21 changes: 10 additions & 11 deletions db/initial.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
- name: EMEA Region
set_fact:
awsRegion: eu-west-2
availabilityZone: us-west-2a
awsAMI: ami-07fb9d5c721566c65
awsRegion: '{{ regionEMEA }}'
availabilityZone: '{{ azEMEA }}'
awsAMI: '{{ amiEMEA }}'
securityGroups: '{{ securityGroupsEMEA }}'
when: userRegion | default("1") == "1"

- name: AMS Region
set_fact:
awsRegion: us-east-2
availabilityZone: us-east-2a
awsAMI: ami-0d77c9d87c7e619f9
awsRegion: '{{ regionAMS }}'
availabilityZone: '{{ azAMS }}'
awsAMI: '{{ amiAMS }}'
securityGroups: '{{ securityGroupsAMS }}'
when: userRegion | default("1") == "2"

- name: APJ Region
set_fact:
awsRegion: ap-southeast-2
availabilityZone: ap-southeast-2a
awsAMI: ami-0d6857b844e855670
awsRegion: '{{ regionAPJ }}'
availabilityZone: '{{ azAPJ }}'
awsAMI: '{{ amiAPJ }}'
securityGroups: '{{ securityGroupsAPJ }}'
when: userRegion | default("1") == "3"

- name: Set AWS Facts
set_fact:
imageName: DB
instanceType: t3.xlarge
instanceType: t3.medium
deviceName: /dev/sda1
volumeType: gp3
volumeSize: 30
2 changes: 1 addition & 1 deletion db/podman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
region: "{{ hostvars['localhost']['awsRegion'] }}"
resource: '{{ item }}'
tags:
Name: "{{ semaphore_vars.task_details.username|upper }}-{{ hostvars['localhost']['imageName'] }} {{ DBSHORT }}"
Name: "{{ semaphore_vars.task_details.username|upper }}-imageName {{ DBSHORT }}"
DB: '{{ DBNAME }}'
DB_USER: '{{ DBUSER }}'
DB_PORT: '{{ DBPORT }}'
Expand Down
1 change: 1 addition & 0 deletions db/variables.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"myUsername": "support",
"myPassword": "strongPassword",
"imageName": "DB",
"keyName": "support",
"keyLocation": "~/.ssh/support.pem",
"securityGroupsEMEA": "['sg-XXXXXX','sg-XXXXXX']",
Expand Down
2 changes: 1 addition & 1 deletion rhel/ed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
region: "{{ hostvars['localhost']['awsRegion'] }}"
resource: '{{ item }}'
tags:
Name: "{{ semaphore_vars.task_details.username|upper }}-{{ hostvars['localhost']['imageName'] }} {{ productName }}"
Name: "{{ semaphore_vars.task_details.username|upper }}-imageName {{ productName }}"
ED: '{{ installerName }}'
state: present
loop: "{{ hostvars['localhost'].ec2.instance_ids }}"
Expand Down
2 changes: 1 addition & 1 deletion rhel/extend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
region: "{{ hostvars['localhost']['awsRegion'] }}"
resource: '{{ item }}'
tags:
Name: "{{ semaphore_vars.task_details.username|upper }}-{{ hostvars['localhost']['imageName'] }} {{ productName }}"
Name: "{{ semaphore_vars.task_details.username|upper }}-imageName {{ productName }}"
extend: '{{ installerName }}'
state: present
loop: "{{ hostvars['localhost'].ec2.instance_ids }}"
Expand Down
19 changes: 9 additions & 10 deletions rhel/initial.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
- name: EMEA Region
set_fact:
awsRegion: eu-west-2
availabilityZone: us-west-2a
awsAMI: ami-07fb9d5c721566c65
awsRegion: '{{ regionEMEA }}'
availabilityZone: '{{ azEMEA }}'
awsAMI: '{{ amiEMEA }}'
securityGroups: '{{ securityGroupsEMEA }}'
when: userRegion | default("1") == "1"

- name: AMS Region
set_fact:
awsRegion: us-east-2
availabilityZone: us-east-2a
awsAMI: ami-0d77c9d87c7e619f9
awsRegion: '{{ regionAMS }}'
availabilityZone: '{{ azAMS }}'
awsAMI: '{{ amiAMS }}'
securityGroups: '{{ securityGroupsAMS }}'
when: userRegion | default("1") == "2"

- name: APJ Region
set_fact:
awsRegion: ap-southeast-2
availabilityZone: ap-southeast-2a
awsAMI: ami-0d6857b844e855670
awsRegion: '{{ regionAPJ }}'
availabilityZone: '{{ azAPJ }}'
awsAMI: '{{ amiAPJ }}'
securityGroups: '{{ securityGroupsAPJ }}'
when: userRegion | default("1") == "3"

- name: Set AWS Facts
set_fact:
imageName: RHEL9
instanceType: t3.xlarge
deviceName: /dev/sda1
volumeType: gp3
Expand Down
1 change: 1 addition & 0 deletions rhel/variables.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"myUsername": "support",
"myPassword": "strongPassword",
"imageName": "RHEL9",
"keyName": "support",
"keyLocation": "~/.ssh/support.pem",
"securityGroupsEMEA": "['sg-XXXXXX','sg-XXXXXX']",
Expand Down
18 changes: 9 additions & 9 deletions win/initial.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
- name: EMEA Region
set_fact:
awsRegion: eu-west-2
availabilityZone: us-west-2a
awsAMI: ami-0be53fc5198dbd294
awsRegion: '{{ regionEMEA }}'
availabilityZone: '{{ azEMEA }}'
awsAMI: '{{ amiEMEA }}'
securityGroups: '{{ securityGroupsEMEA }}'
when: userRegion | default("1") == "1"

- name: AMS Region
set_fact:
awsRegion: us-east-2
availabilityZone: us-east-2a
awsAMI: ami-0e6aa5f69f06ffa91
awsRegion: '{{ regionAMS }}'
availabilityZone: '{{ azAMS }}'
awsAMI: '{{ amiAMS }}'
securityGroups: '{{ securityGroupsAMS }}'
when: userRegion | default("1") == "2"

- name: APJ Region
set_fact:
awsRegion: ap-southeast-2
availabilityZone: ap-southeast-2a
awsAMI: ami-02ed1a17d1bd5f706
awsRegion: '{{ regionAPJ }}'
availabilityZone: '{{ azAPJ }}'
awsAMI: '{{ amiAPJ }}'
securityGroups: '{{ securityGroupsAPJ }}'
when: userRegion | default("1") == "3"

Expand Down

0 comments on commit e10049e

Please sign in to comment.