Skip to content

Commit f3b1878

Browse files
committed
add cluster bits
1 parent 2b241b9 commit f3b1878

File tree

4 files changed

+549
-1
lines changed

4 files changed

+549
-1
lines changed

olam/build.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,40 @@
112112
ansible_host: "{{ instance_public_ip }}"
113113
ansible_port: 22
114114
instance_ocid: "{{ instance_id }}"
115+
116+
- name: Create host ini file
117+
ansible.builtin.lineinfile:
118+
path: hosts
119+
regexp: '^\[{{ host_group }}'
120+
line: "[{{ host_group }}]"
121+
create: true
122+
mode: "0664"
123+
delegate_to: localhost
124+
loop:
125+
- control
126+
- execution
127+
- db
128+
loop_control:
129+
loop_var: host_group
130+
131+
- name: Add host to ini host file
132+
ansible.builtin.lineinfile:
133+
path: hosts
134+
regexp: '^{{ instance_name }}'
135+
line: >-
136+
{{ instance_name }}
137+
ansible_host={{ instance_ansible_host }}
138+
ansible_user={{ instance_ansible_user }}
139+
ansible_private_key_file={{ instance_ansible_private_key_file }}
140+
ansible_ssh_common_args={{ instance_ansible_ssh_common_args | quote }}
141+
insertafter: '^\[{{ item.value.type }}\]$'
142+
create: true
143+
mode: "664"
144+
delegate_to: localhost
145+
vars:
146+
instance_name: "{{ instance_display_name }}"
147+
instance_ansible_user: opc
148+
instance_ansible_private_key_file: "{{ lookup('env', 'HOME') + '/.ssh/' + private_key }}"
149+
instance_ansible_ssh_common_args: "-o StrictHostKeyChecking=no"
150+
instance_ansible_host: "{{ instance_public_ip }}"
151+
instance_ansible_port: 22

0 commit comments

Comments
 (0)