blob: 7fbb78a29e03c6a4ffc0c12c648d97be71e459ea [file] [log] [blame]
Peter Pentchevf48f48b2022-12-07 16:51:16 +02001- hosts: all
2 tasks:
Peter Pentchevf48f48b2022-12-07 16:51:16 +02003 - name: Install juju
Peter Pentchevd26369b2022-12-08 11:39:21 +02004 ansible.builtin.command: snap install juju --classic
5 become: true
Peter Pentchevf48f48b2022-12-07 16:51:16 +02006
7 - name: Log In to the Controller
Biser Milanovea8c5c52022-12-13 09:56:47 +02008 no_log: true
Peter Pentchevdec9e8f2022-12-08 14:33:20 +02009 block:
Biser Milanov9947da92022-12-13 14:52:05 +020010
Peter Pentchevdec9e8f2022-12-08 14:33:20 +020011 - name: Log in
Biser Milanov67e48882023-11-21 17:52:26 +020012 ansible.builtin.shell: juju login 10.4.2.241:17070 --controller maas-controller --user zuul-nodepool-zaza
Peter Pentchevdec9e8f2022-12-08 14:33:20 +020013 args:
14 stdin: "y\n{{ juju_secret['the_secret'] }}\n"
15
16 - name: Enter our password a second time
17 ansible.builtin.shell: juju clouds
18 args:
19 stdin: "{{ juju_secret['the_secret'] }}\n"
20
Biser Milanov9947da92022-12-13 14:52:05 +020021 - name: Prepare Juju credentials file
22 ansible.builtin.shell: umask 177 && echo "credentials:" > ~/.local/share/juju/credentials.yaml
23 args:
24 executable: /usr/bin/bash
Peter Pentchevdec9e8f2022-12-08 14:33:20 +020025
Biser Milanov9947da92022-12-13 14:52:05 +020026 - name: Grab the Juju credentials and store them in a file
27 ansible.builtin.shell: juju credentials --controller maas-controller --format yaml --show-secrets | tail -n +2 >> ~/.local/share/juju/credentials.yaml
28 args:
29 executable: /usr/bin/bash
Biser Milanov81e9eb92023-11-21 17:58:56 +020030 always:
31 - name: Debug sleep
32 ansible.builtin.shell: sleep 9999