blob: de3a0c42877d68253120bee82326757f683de400 [file] [log] [blame]
Peter Pentchevf48f48b2022-12-07 16:51:16 +02001- hosts: all
2 tasks:
3 # TODO: snap module is part of the community collection
4 - name: Install juju
Peter Pentchevd26369b2022-12-08 11:39:21 +02005 ansible.builtin.command: snap install juju --classic
6 become: true
Peter Pentchevf48f48b2022-12-07 16:51:16 +02007
8 - name: Log In to the Controller
Biser Milanovea8c5c52022-12-13 09:56:47 +02009 no_log: true
Peter Pentchevdec9e8f2022-12-08 14:33:20 +020010 block:
Biser Milanov9947da92022-12-13 14:52:05 +020011
Peter Pentchevdec9e8f2022-12-08 14:33:20 +020012 - name: Log in
13 ansible.builtin.shell: juju login 10.40.2.2:17070 --controller maas-controller --user zuul-nodepool-zaza
14 args:
15 stdin: "y\n{{ juju_secret['the_secret'] }}\n"
16
17 - name: Enter our password a second time
18 ansible.builtin.shell: juju clouds
19 args:
20 stdin: "{{ juju_secret['the_secret'] }}\n"
21
Biser Milanov9947da92022-12-13 14:52:05 +020022 - name: Prepare Juju credentials file
23 ansible.builtin.shell: umask 177 && echo "credentials:" > ~/.local/share/juju/credentials.yaml
24 args:
25 executable: /usr/bin/bash
Peter Pentchevdec9e8f2022-12-08 14:33:20 +020026
Biser Milanov9947da92022-12-13 14:52:05 +020027 - name: Grab the Juju credentials and store them in a file
28 ansible.builtin.shell: juju credentials --controller maas-controller --format yaml --show-secrets | tail -n +2 >> ~/.local/share/juju/credentials.yaml
29 args:
30 executable: /usr/bin/bash
31