From 4224035e0e1d0094dce4508b5ebc675d233bfabb Mon Sep 17 00:00:00 2001 From: Talha Bin Rizwan Date: Wed, 28 Jun 2023 22:03:37 +0500 Subject: [PATCH] PMM-7 Fix user for OL9 OVF (#2319) (#2325) --- build/ansible/roles/cloud-node/tasks/main.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/build/ansible/roles/cloud-node/tasks/main.yml b/build/ansible/roles/cloud-node/tasks/main.yml index fb3035bd6e..edcbe3104d 100644 --- a/build/ansible/roles/cloud-node/tasks/main.yml +++ b/build/ansible/roles/cloud-node/tasks/main.yml @@ -129,8 +129,23 @@ regexp: "name: centos" replace: "name: admin" -- name: change cloud user EL9 | Change cloud user - when: create_admin == "true" and (ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux') and ansible_distribution_major_version == '9' +- name: change cloud user for OVF EL9 | Change cloud user + when: + - create_admin == "true" + - ansible_virtualization_type == "virtualbox" + - ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux' + - ansible_distribution_major_version == '9' + replace: + dest: /etc/cloud/cloud.cfg + regexp: "name: cloud-user" + replace: "name: admin" + +- name: change cloud user for AMI EL9 | Change cloud user + when: + - create_admin == "true" + - ansible_virtualization_type != "virtualbox" + - ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux' + - ansible_distribution_major_version == '9' replace: dest: /etc/cloud/cloud.cfg.d/00_ol-default-user.cfg regexp: "name: ec2-user"