From c33c61192640f01997a445b04e6760f3703106cf Mon Sep 17 00:00:00 2001 From: Vatsal Parekh Date: Tue, 29 Sep 2020 13:47:31 +0530 Subject: [PATCH] Add default cloud users to cloud-init (#224) Signed-off-by: Vatsal Parekh --- generate-templates.yaml | 9 +++++++++ templates/_linux.yaml | 1 + 2 files changed, 10 insertions(+) diff --git a/generate-templates.yaml b/generate-templates.yaml index 1c0260f4..221cde85 100644 --- a/generate-templates.yaml +++ b/generate-templates.yaml @@ -34,6 +34,7 @@ icon: rhel oslabels: "{{ rhel8_labels }}" osinfoname: "{{ oslabels[0] }}" + cloudusername: cloud-user - name: Load RHEL 7 versions set_fact: @@ -61,6 +62,7 @@ icon: rhel oslabels: "{{ rhel7_labels }}" osinfoname: "{{ oslabels[0] }}" + cloudusername: cloud-user - name: Load RHEL 6 versions set_fact: @@ -84,6 +86,7 @@ icon: rhel oslabels: "{{ rhel6_labels }}" osinfoname: "{{ oslabels[0] }}" + cloudusername: cloud-user - name: Generate CentOS 8 templates template: @@ -104,6 +107,7 @@ oslabels: - centos8 osinfoname: "{{ oslabels[0] }}" + cloudusername: centos - name: Generate CentOS 7 templates template: @@ -124,6 +128,7 @@ oslabels: - centos7.0 osinfoname: "{{ oslabels[0] }}" + cloudusername: centos - name: Load CentOS 6 versions set_fact: @@ -143,6 +148,7 @@ icon: centos oslabels: "{{ centos6_labels }}" osinfoname: "{{ oslabels[0] }}" + cloudusername: centos - name: Load Fedora versions set_fact: @@ -170,6 +176,7 @@ icon: fedora oslabels: "{{ fedora_labels }}" osinfoname: "{{ oslabels[0] }}" + cloudusername: fedora - name: Generate OpenSUSE templates template: @@ -186,6 +193,7 @@ oslabels: - opensuse15.0 osinfoname: "{{ oslabels[0] }}" + cloudusername: opensuse - name: Generate Ubuntu templates template: @@ -203,6 +211,7 @@ oslabels: - ubuntu18.04 osinfoname: "{{ oslabels[0] }}" + cloudusername: ubuntu - name: Generate Windows server templates template: diff --git a/templates/_linux.yaml b/templates/_linux.yaml index 6433ce8d..48a8e97c 100644 --- a/templates/_linux.yaml +++ b/templates/_linux.yaml @@ -102,6 +102,7 @@ objects: - cloudInitNoCloud: userData: |- #cloud-config + user: {{ cloudusername }} password: ${CLOUD_USER_PASSWORD} chpasswd: { expire: False } name: cloudinitdisk