Revert to old creds provisioning style
Change-Id: Ifc3ca264ed3d091e77a033ad18ccd2dc7ed0d67c
diff --git a/playbooks/setup-juju-client/pre.yaml b/playbooks/setup-juju-client/pre.yaml
index fe59758..de3a0c4 100644
--- a/playbooks/setup-juju-client/pre.yaml
+++ b/playbooks/setup-juju-client/pre.yaml
@@ -8,6 +8,7 @@
- name: Log In to the Controller
no_log: true
block:
+
- name: Log in
ansible.builtin.shell: juju login 10.40.2.2:17070 --controller maas-controller --user zuul-nodepool-zaza
args:
@@ -18,11 +19,13 @@
args:
stdin: "{{ juju_secret['the_secret'] }}\n"
- - name: Grab the Ansible credentials
- ansible.builtin.shell: juju credentials --controller maas-controller --format yaml --show-secrets
- register: juju_credentials_full
+ - name: Prepare Juju credentials file
+ ansible.builtin.shell: umask 177 && echo "credentials:" > ~/.local/share/juju/credentials.yaml
+ args:
+ executable: /usr/bin/bash
- - name: Store them into a file
- ansible.builtin.copy:
- dest: /home/ubuntu/.local/share/juju/credentials.yaml
- content: "credentials:\n{{ juju_credentials_full.stdout_lines[1:] | join('\n') }}\n"
+ - name: Grab the Juju credentials and store them in a file
+ ansible.builtin.shell: juju credentials --controller maas-controller --format yaml --show-secrets | tail -n +2 >> ~/.local/share/juju/credentials.yaml
+ args:
+ executable: /usr/bin/bash
+