From 421111d9150b506a324f32c82b6ccb9abf7fb6c9 Mon Sep 17 00:00:00 2001 From: pmikus Date: Mon, 22 Jul 2024 13:51:10 +0200 Subject: feat(infra): Ubuntu 24.04 LTS Signed-off-by: Peter Mikus Change-Id: I81e48360fcc970a16f1203955003d59f476b3233 --- fdio.infra.ansible/roles/docker/defaults/main.yaml | 2 +- fdio.infra.ansible/roles/docker/handlers/main.yaml | 2 +- fdio.infra.ansible/roles/docker/meta/main.yaml | 21 ++++++++------- fdio.infra.ansible/roles/docker/tasks/Debian.yaml | 30 ++++++++++++++++++++++ fdio.infra.ansible/roles/docker/tasks/jammy.yaml | 30 ---------------------- fdio.infra.ansible/roles/docker/tasks/main.yaml | 24 ++++++++++------- 6 files changed, 59 insertions(+), 50 deletions(-) create mode 100644 fdio.infra.ansible/roles/docker/tasks/Debian.yaml delete mode 100644 fdio.infra.ansible/roles/docker/tasks/jammy.yaml (limited to 'fdio.infra.ansible/roles/docker') diff --git a/fdio.infra.ansible/roles/docker/defaults/main.yaml b/fdio.infra.ansible/roles/docker/defaults/main.yaml index bf97b4a192..e0338fb5ad 100644 --- a/fdio.infra.ansible/roles/docker/defaults/main.yaml +++ b/fdio.infra.ansible/roles/docker/defaults/main.yaml @@ -1,5 +1,5 @@ --- -# file: roles/docker/defaults/main.yaml +# file: defaults/main.yaml # Version options. docker_edition: "ce" diff --git a/fdio.infra.ansible/roles/docker/handlers/main.yaml b/fdio.infra.ansible/roles/docker/handlers/main.yaml index 53eb8528f6..c8c3328cac 100644 --- a/fdio.infra.ansible/roles/docker/handlers/main.yaml +++ b/fdio.infra.ansible/roles/docker/handlers/main.yaml @@ -1,5 +1,5 @@ --- -# file roles/docker/handlers/main.yaml +# file handlers/main.yaml - name: Restart Docker ansible.builtin.service: diff --git a/fdio.infra.ansible/roles/docker/meta/main.yaml b/fdio.infra.ansible/roles/docker/meta/main.yaml index 7bef656eb5..0a1fe9787b 100644 --- a/fdio.infra.ansible/roles/docker/meta/main.yaml +++ b/fdio.infra.ansible/roles/docker/meta/main.yaml @@ -4,15 +4,18 @@ dependencies: [] galaxy_info: - role_name: docker - author: fd.io - description: Docker-CE for Linux. - company: none - license: "license (Apache)" - min_ansible_version: 2.9 + role_name: "docker" + author: "pmikus" + description: "Docker-CE for Linux." + company: "none" + license: "license (BSD, MIT)" + min_ansible_version: "2.9" platforms: - - name: Ubuntu + - name: "Ubuntu" versions: - - jammy + - "jammy" + - name: "Debian" + versions: + - "bookworm" galaxy_tags: - - docker + - "docker" diff --git a/fdio.infra.ansible/roles/docker/tasks/Debian.yaml b/fdio.infra.ansible/roles/docker/tasks/Debian.yaml new file mode 100644 index 0000000000..f81277ac47 --- /dev/null +++ b/fdio.infra.ansible/roles/docker/tasks/Debian.yaml @@ -0,0 +1,30 @@ +--- +# file: tasks/Debian.yaml + +- name: "Install Dependencies" + ansible.builtin.apt: + name: + - "apt-transport-https" + - "ca-certificates" + - "gpg-agent" + - "software-properties-common" + state: "present" + cache_valid_time: 3600 + install_recommends: false + tags: + - docker-inst-dependencies + +- name: "Add APT Key" + ansible.builtin.apt_key: + url: "{{ docker_apt_gpg_key }}" + state: "{{ docker_apt_gpg_key_state }}" + tags: + - docker-conf-apt + +- name: "Install APT Repository" + ansible.builtin.apt_repository: + repo: "{{ docker_apt_repository }}" + state: "{{ docker_apt_repository_state }}" + update_cache: true + tags: + - docker-conf-apt diff --git a/fdio.infra.ansible/roles/docker/tasks/jammy.yaml b/fdio.infra.ansible/roles/docker/tasks/jammy.yaml deleted file mode 100644 index 8ec7a01ee1..0000000000 --- a/fdio.infra.ansible/roles/docker/tasks/jammy.yaml +++ /dev/null @@ -1,30 +0,0 @@ ---- -# file: roles/docker/tasks/ubuntu_jammy.yaml - -- name: Inst - Dependencies - ansible.builtin.apt: - name: - - "apt-transport-https" - - "ca-certificates" - - "gpg-agent" - - "software-properties-common" - state: "present" - cache_valid_time: 3600 - install_recommends: false - tags: - - docker-inst-dependencies - -- name: Conf - Add APT Key - ansible.builtin.apt_key: - url: "{{ docker_apt_gpg_key }}" - state: "{{ docker_apt_gpg_key_state }}" - tags: - - docker-conf-apt - -- name: Conf - Install APT Repository - ansible.builtin.apt_repository: - repo: "{{ docker_apt_repository }}" - state: "{{ docker_apt_repository_state }}" - update_cache: true - tags: - - docker-conf-apt diff --git a/fdio.infra.ansible/roles/docker/tasks/main.yaml b/fdio.infra.ansible/roles/docker/tasks/main.yaml index e07b29e363..4146dbbadf 100644 --- a/fdio.infra.ansible/roles/docker/tasks/main.yaml +++ b/fdio.infra.ansible/roles/docker/tasks/main.yaml @@ -1,11 +1,17 @@ --- -# file: roles/docker/tasks/main.yaml +# file: tasks/main.yaml -- include_tasks: "{{ ansible_distribution_release }}.yaml" +- name: "Install Prerequisites Based on OS" + ansible.builtin.include_tasks: + file: "{{ item }}" + with_first_found: + - files: + - "{{ ansible_os_family }}.yaml" + - "default.yaml" tags: - docker-inst-dependencies -- name: Inst - Docker +- name: "Install Docker" ansible.builtin.package: name: - "{{ docker_package }}" @@ -14,7 +20,7 @@ tags: - docker-inst-package -- name: Conf - Docker Service +- name: "Enable Docker Service" ansible.builtin.service: name: docker state: "{{ docker_service_state }}" @@ -24,7 +30,7 @@ tags: - docker-conf-service -- name: Conf - Docker Service Directory +- name: "Docker Service Directory" ansible.builtin.file: path: "/etc/systemd/system/docker.service.d" state: "directory" @@ -34,7 +40,7 @@ tags: - docker-conf-service -- name: Conf - Docker Daemon +- name: "Configure Docker Daemon" ansible.builtin.template: src: "templates/daemon.json.j2" dest: "/etc/docker/daemon.json" @@ -49,7 +55,7 @@ tags: - docker-conf-daemon -- name: Conf - Docker HTTP Proxy +- name: "Configure Docker HTTP Proxy" ansible.builtin.template: src: "templates/docker.service.proxy.http" dest: "/etc/systemd/system/docker.service.d/http-proxy.conf" @@ -65,7 +71,7 @@ tags: - docker-conf-service -- name: Conf - Docker HTTPS Proxy +- name: "Configure Docker HTTPS Proxy" ansible.builtin.template: src: "templates/docker.service.proxy.https" dest: "/etc/systemd/system/docker.service.d/https-proxy.conf" @@ -81,5 +87,5 @@ tags: - docker-conf-service -- name: Meta - Flush handlers +- name: "Meta - Flush handlers" ansible.builtin.meta: flush_handlers -- cgit 1.2.3-korg