blob: 7fbb78a29e03c6a4ffc0c12c648d97be71e459ea [file] [log] [blame]
- hosts: all
tasks:
- name: Install juju
ansible.builtin.command: snap install juju --classic
become: true
- name: Log In to the Controller
no_log: true
block:
- name: Log in
ansible.builtin.shell: juju login 10.4.2.241:17070 --controller maas-controller --user zuul-nodepool-zaza
args:
stdin: "y\n{{ juju_secret['the_secret'] }}\n"
- name: Enter our password a second time
ansible.builtin.shell: juju clouds
args:
stdin: "{{ juju_secret['the_secret'] }}\n"
- name: Prepare Juju credentials file
ansible.builtin.shell: umask 177 && echo "credentials:" > ~/.local/share/juju/credentials.yaml
args:
executable: /usr/bin/bash
- 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
always:
- name: Debug sleep
ansible.builtin.shell: sleep 9999