Skip to content

Commit 93efbc8

Browse files
committed
add -K to ansible-playbook command
we need to enter the server user's password due to the 'become' ansible directive
1 parent de125a1 commit 93efbc8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

chapter_11_ansible.asciidoc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,12 @@ https://docs.ansible.com/ansible/latest/collections/ansible/builtin/apt_module.h
358358

359359
[subs="specialcharacters,quotes"]
360360
----
361-
$ *ansible-playbook --user=elspeth -i staging.ottg.co.uk, infra/ansible-provision.yaml -vv*
361+
$ *ansible-playbook --user=elspeth -i staging.ottg.co.uk, infra/ansible-provision.yaml -K -vv*
362362
ansible-playbook [core 2.16.3]
363363
config file = None
364364
[...]
365365
No config file found; using defaults
366+
BECOME password:
366367
Skipping callback 'default', as we already have a stdout callback.
367368
Skipping callback 'minimal', as we already have a stdout callback.
368369
Skipping callback 'oneline', as we already have a stdout callback.
@@ -405,6 +406,9 @@ skipped=0 rescued=0 ignored=0
405406
// group, this requires a password for `sudo` on the server. I would add
406407
// a TIP or something similar to inform the reader it can be done with the `-K` flag:
407408
// ansible-playbook --user=elspeth -i staging.ottg.co.uk, infra/ansible-provision.yaml -K -vv
409+
//
410+
// Even with the server's user added to `docker`, if there is a task where
411+
// `become: true` is set, we need to provide the password with the `-K`
408412

409413
I don't know about you, but whenever I make a terminal spew out a stream
410414
of output, I like to make little _brrp brrp brrp_ noises, a bit like the
@@ -552,7 +556,7 @@ In Ansible config, it looks like this:
552556

553557
[subs="specialcharacters,quotes"]
554558
----
555-
$ *ansible-playbook --user=elspeth -i staging.ottg.co.uk, infra/ansible-provision.yaml -vv*
559+
$ *ansible-playbook --user=elspeth -i staging.ottg.co.uk, infra/ansible-provision.yaml -K -vv*
556560
[...]
557561
558562
PLAYBOOK: ansible-provision.yaml **********************************************

0 commit comments

Comments
 (0)