Skip to content

Commit 9d723fe

Browse files
committed
add olvm provision status file
1 parent 0de4bbf commit 9d723fe

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

olvm/configure_secondary_nic.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@
9090
with_items: "{{ ansible_interfaces | select('match', '^(ens|enp|eth)') | list }}"
9191
when: ansible_facts[item].macaddress is defined and ansible_facts[item].macaddress == mac_addr
9292

93+
- name: Check if kvm hosts added to olvm cluster
94+
ansible.builtin.stat:
95+
path: /tmp/.olvm-provisioned
96+
register: olvm_provision
97+
9398
- name: Assign static IP
9499
community.general.nmcli:
95100
conn_name: "ethernet-{{ interface }}"
@@ -99,6 +104,7 @@
99104
gw4: 10.0.1.1
100105
state: present
101106
become: true
107+
when: not olvm_provision.stat.exists
102108

103109
- name: Add two IPv4 DNS server addresses
104110
community.general.nmcli:
@@ -109,3 +115,4 @@
109115
- 169.254.169.254
110116
state: present
111117
become: true
118+
when: not olvm_provision.stat.exists

olvm/default_vars.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ instance_shape: "VM.Standard.E4.Flex"
1616
subnet1_cidr_block: "10.0.0.0/24"
1717
subnet2_cidr_block: "10.0.1.0/24"
1818
vlan_cidr_block: 10.0.10.0/24
19+
oci_config_section: DEFAULT
20+
ad_placement: 1
1921

2022
username: "oracle"
2123
usergroup: "{{ username }}"

olvm/ovirt_add_hosts.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,16 @@
5858
ovirt_auth: "{{ ovirt_auth }}"
5959
tags:
6060
- always
61+
62+
- name: Create .olvm-provisioned file in /tmp
63+
hosts: engine:kvm
64+
vars_files:
65+
- default_vars.yml
66+
67+
tasks:
68+
69+
- name: Create provisioned status file
70+
ansible.builtin.file:
71+
path: /tmp/.olvm-provisioned
72+
state: touch
73+
mode: '0755'

0 commit comments

Comments
 (0)