@@ -401,6 +401,10 @@ PLAY RECAP ********************************************************************
401
401
staging.ottg.co.uk : ok=3 changed=2 unreachable=0 failed=0
402
402
skipped=0 rescued=0 ignored=0
403
403
----
404
+ // CSANAD: without rootless docker or adding the server's user to the docker
405
+ // group, this requires a password for `sudo` on the server. I would add
406
+ // a TIP or something similar to inform the reader it can be done with the `-K` flag:
407
+ // ansible-playbook --user=elspeth -i staging.ottg.co.uk, infra/ansible-provision.yaml -K -vv
404
408
405
409
I don't know about you, but whenever I make a terminal spew out a stream
406
410
of output, I like to make little _brrp brrp brrp_ noises, a bit like the
@@ -434,6 +438,8 @@ minutes ago testcontainer
434
438
elspeth@server:$ *docker logs testcontainer*
435
439
hello world
436
440
----
441
+ // CSANAD: we haven't set up rootless docker and haven't added the user to the
442
+ // `docker` group either, so `docker ps` would only run with sudo.
437
443
438
444
TIP: Look out for that `elspeth@server`
439
445
in the command-line listings in this chapter.
@@ -523,6 +529,17 @@ In Ansible config, it looks like this:
523
529
====
524
530
// CSANAD: I would add `update_cache: true` to the `Install docker` task back,
525
531
// it's a good practice to update the apt cache before installing.
532
+ //
533
+ // Also because of the `delegate_to` the reader may face permission errors if they
534
+ // have not set up rootless docker or haven't added their user to the docker group
535
+ // on their local (developer) system.
536
+ // TASK [Export container image locally] ****[...]
537
+ // task path: /path/to/goat-book/infra/ansible-provision.yaml:12
538
+ // fatal: [192.168.122.23 -> 127.0.0.1]: FAILED! => {"changed": false, "msg": "Error connecting: Error while fetching server API version: ('Connection aborted.', PermissionError(13, 'Permission denied'))"}
539
+ //
540
+ // They may get away with just using `sudo docker` but `sudo ansible-playbook`
541
+ // will not work.
542
+ //
526
543
527
544
<1> We export the docker image to a `.tar` file by using the `docker_image` module
528
545
with the `archive_path` set to temp file, and setting the `delegate_to` attribute
0 commit comments