- hosts: all | |
tasks: | |
# TODO: snap module is part of the community collection | |
- 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.40.2.2: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 | |