15 Commits

Author SHA1 Message Date
Tristan Cacqueray
6cd8980fc3 ensure-docker: prevent issue on centos-7 where the socket does not exists
This change mitigate an issue introduced by
https://review.opendev.org/c/zuul/zuul-jobs/+/787271

Fixes: https://bugs.launchpad.net/tripleo/+bug/1925372
Change-Id: I49f527b1c8a16e0b9f1718f23a960733003909ca
2021-04-21 17:12:09 +00:00
Gonéri Le Bouder
2bb9b4995a ensure-docker: ensure docker.socket is stopped
On Centos8, during the docker-ce installation, the docker.socket service
is start with a bogus state:

docker.socket: Socket unit configuration has changed while unit has been running, no open socket file descriptor left. The socket unit is not functional until restarted.

Later, when the `Assure docker service is running` task tries to start
the service, it fails with the following error:

dockerd[29743]: failed to load listeners: no sockets found via socket activation: make sure the service was started by systemd

Example:
https://0c7366f2ce9149f2de0c-399b55a396b5093070500a70ecbf09b9.ssl.cf1.rackcdn.com/410/c233496b96c70cfc6204e75d10116a96b08d4663/check/ansible-test-sanity-docker/787388f/ara-report/index.html

Another example: https://github.com/kata-containers/tests/issues/3103

Also: Remove use of kubectl --generator=run-pod/v1

This has been deprecated since 1.17 and removed since 1.20. run-pod wound
up being the only generator that did anything, so this parameter became a
no-op. This has to be squashed into this commit to unbreak the gate.

Change-Id: I666046fe2a3aa079643092c71573803851a67be2
2021-04-20 18:44:37 -05:00
Sorin Sbarnea
d31aa166f4 Update ensure-docker for new releases
Docker just released official packages for centos-8 so
we need to remove the temporary workaround that installs the
previous release version.

Change-Id: I787ce82b895069f4846fcdb35f55f0c9ad53652c
2020-11-03 14:06:13 +00:00
Zuul
7e150858e4 Merge "Use ansible_distribution* facts instead of ansible_lsb" 2020-10-12 18:24:58 +00:00
Ian Wienand
664d068ef7 ensure-docker: < 1500 MTU workaround
As described inline, we should lower the MTU in the docker
configuration when we see the interface has a MTU lower than 1500 so
things "just work".  This particularly affects the Linaro ARM64 cloud
in OpenDev, but it is a generic issue.

Change-Id: I338616c41a65b007d56648fdab6da2a6a6b909f4
Story: https://storyboard.openstack.org/#!/story/2008230
2020-10-06 11:26:15 +00:00
Ian Wienand
0b9fad9583 update-json-file: add role to combine values into a .json
Ansible doens't really have a great built-in way to modify a json file
(unlike ini files).  The extant docker role does what seems to be the
usual standard, which is slurp in the file, parse it and then write it
back out.

In a follow-on change (I338616c41a65b007d56648fdab6da2a6a6b909f4) we
need to set some more values in the docker configuration .json file,
which made me think it's generic enough that we can have a role to
basically run read the file, |combine and write it back out.

This adds such a role with various options, and converts the existing
json configuration update in ensure-docker to use it.

Change-Id: I155a409945e0175249cf2dc630b839c7a97fb452
2020-10-05 15:18:58 +11:00
Pierre-Louis Bonicoli
56d37dc542
Use ansible_distribution* facts instead of ansible_lsb
lsb_release executable might not be available.

The following errors occur when lsb_release isn't available:

    TASK [ensure-docker : Sanity check for upstream install mirrors]
    ERROR
    {
      "msg": "The conditional check '(docker_mirror_base_url | length) < 1' failed.
              The error was: error while evaluating conditional ((docker_mirror_base_url | length) < 1):
              'dict object' has no attribute 'id' [...]"
    }

    LOOP [ensure-package-repositories : Add apt repositories]
    ERROR
    {
      "msg": "'dict object' has no attribute 'codename'"
    }

Change-Id: I93ea718f24bd7176dca9daa82fe5b2635e21d730
2020-09-17 09:31:13 +02:00
Ian Wienand
bd992f3a76 ensure-docker: remove amd64 architecture pin
Just let this install the repo for whatever architecture we're running
on.

Change-Id: Ifdff9b731db5d5ab93dd7da6f7d8a311b3162113
2020-08-14 10:30:03 +10:00
Pierre-Louis Bonicoli
222056a26f
Avoid to use 'length' filter with null value
This error occurs when variables are null and
DEFAULT_JINJA2_NATIVE is enabled:

    object of type 'NoneType' has no len()

Change-Id: I7c69be60b846c03e30a0a6e8893bf2f3a3d5e5b8
2020-08-03 03:31:29 +02:00
Sorin Sbarnea
9f222677e2 ensure-docker: workaround for centos-8 conflicts
- assured configured repository is based on original repository definition
- workaround for bypassing rpm installation conflicts
  on CentOS/RHEL-8.
- we no longer need special dnf command for installation.

Change-Id: I0b2ccd788f8010b864c45140189dcb215e7c82fb
2020-05-19 19:16:20 +01:00
Zuul
9d2015d31a Merge "Check for loop_control in with_ type loops" 2020-05-01 16:06:16 +00:00
Mohammed Naser
00cc4aa038 ensure-docker: refactor to use ensure-package-repositories
This patch refactors ensure-docker to use the new ensure-package-repostories
role which cleans up the codebase for it a lot.  It also converges the
Debian and Ubuntu configuration as they were pretty much the same.

Also, it updates the Docker to the proper GPG key as while refactoring,
it was exposed that it was using the wrong key.  Docker uses a different
key for Debian and RHEL based packaging.

Change-Id: Iad430c6a31be0750c1a0f50e12a26df230de9f4e
2020-05-01 15:49:30 +02:00
Albin Vass
9062289151 Check for loop_control in with_ type loops
Change-Id: I191265df7709a6262b44a428d78fe28ffaeb4b75
2020-05-01 13:45:34 +02:00
Andreas Jaeger
2026f1825b Use main.yaml, not .yml
There are over 490 .yaml files but only a few .yml, let's rename to be
consistent.

Add a test to block .yml files.

Change-Id: I2f1354de82f231154d926b51d9812b1e9c1a6202
2020-04-20 17:44:49 +02:00
vass
c80b593fb6 Rename install-docker to ensure-docker for consistency
The old role will be kept and include ensure-docker for backwards compatability.

Change-Id: Icb76a954b04631c405b09eb54343fd852a511b83
2020-04-04 15:41:29 -04:00