-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remvove cloud-init dropin for custom vmware guest datasource
- Loading branch information
1 parent
6e46531
commit 68cbfe7
Showing
2 changed files
with
52 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
- name: Get package facts | ||
ansible.builtin.package_facts: | ||
manager: "auto" | ||
|
||
- name: Set cloud-init version | ||
ansible.builtin.set_fact: | ||
cloud_init_version: "{{ ansible_facts.packages['cloud-init'][0].version }}" | ||
|
||
# this program used by ds-identify to determine whether or not the | ||
# VMwareGuestInfo datasource is useable. | ||
- name: Directly install GuestInfo | ||
when: cloud_init_version is version('21.3', '<') | ||
block: | ||
|
||
- name: Copy vmware guestinfo datasource | ||
copy: | ||
src: "{{ item }}" | ||
dest: /tmp/ | ||
owner: root | ||
group: root | ||
mode: 0755 | ||
with_items: | ||
- cloud-init-vmware.sh | ||
- DataSourceVMwareGuestInfo.py | ||
|
||
- name: Create ds-check program to verify VMwareGuestInfo datasource | ||
copy: | ||
src: files/dscheck_VMwareGuestInfo.sh | ||
dest: /usr/bin/dscheck_VMwareGuestInfo | ||
owner: root | ||
group: root | ||
mode: 0755 | ||
|
||
- name: Execute cloud-init-vmware.sh | ||
shell: bash -o errexit -o pipefail /tmp/cloud-init-vmware.sh | ||
environment: | ||
VMWARE_DS_PATH: '/tmp/DataSourceVMwareGuestInfo.py' | ||
|
||
- name: Remove cloud-init-vmware.sh | ||
file: | ||
path: /tmp/cloud-init-vmware.sh | ||
state: absent | ||
|
||
# sets the datasource_list to VMwareGuestInfo for all OS | ||
# ensure that VMwareGuestInfo overrides existing datasource drop-ins if it exists. | ||
- name: Copy cloud-init config file for vmware | ||
copy: | ||
src: files/etc/cloud/cloud.cfg.d/99-DataSourceVMwareGuestInfo.cfg | ||
dest: /etc/cloud/cloud.cfg.d/99-DataSourceVMwareGuestInfo.cfg | ||
owner: root | ||
group: root | ||
mode: 0644 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters