Ensure that static hosts have docker and the latest python versions installed
Some checks failed
Ansible Linting / ansible-lint (push) Failing after 4s
Some checks failed
Ansible Linting / ansible-lint (push) Failing after 4s
This commit is contained in:
49
playbooks/static/tasks/main.yaml
Normal file
49
playbooks/static/tasks/main.yaml
Normal file
@@ -0,0 +1,49 @@
|
||||
# Things that we definitely want to have are the following
|
||||
# docker docker-compose python(latest) certbot
|
||||
- name: Install base dependencies
|
||||
ansible.builtin.apt:
|
||||
update_cache: true
|
||||
pkg:
|
||||
- ca-certificates
|
||||
- curl
|
||||
- lsb_release
|
||||
- name: Setup keyring
|
||||
ansible.builtin.command:
|
||||
cmd: "install -m 0755 -d {{ static_keyring_dir }}"
|
||||
creates: "{{ static_keyring_dir }}"
|
||||
- name: Download the docker GPG key
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ static_docker_ubuntu }}/gpg"
|
||||
dest: "{{ static_keyring_dir }}"
|
||||
mode: "0644"
|
||||
- name: Set permissions on the docker ASC in our keyring
|
||||
ansible.builtin.file:
|
||||
state: file
|
||||
dest: "{{ static_keyring_dir }}/docker.asc"
|
||||
mode: "0644"
|
||||
- name: Get os codename
|
||||
ansible.builtin.shell:
|
||||
cmd: set -o pipefail && lsb_release -sc | tr -d '\n'
|
||||
args:
|
||||
executable: /usr/bin/bash
|
||||
register: codename
|
||||
changed_when: false
|
||||
- name: Ensure docker.lst is present
|
||||
vars:
|
||||
key_path: "{{ static_keyring_dir }}/docker.asc"
|
||||
repo: "{{ static_docker_ubuntu }}"
|
||||
os_codename: "{{ codename.stdout }}"
|
||||
ansible.builtin.template:
|
||||
src: docker.list
|
||||
dest: "{{ static_apt_sources_dir }}/docker.list"
|
||||
mode: "0644"
|
||||
- name: Install docker and python packages
|
||||
ansible.builtin.apt:
|
||||
update_cache: true
|
||||
pkg:
|
||||
- docker-ce
|
||||
- docker-ce-cli
|
||||
- containerd.io
|
||||
- docker-buildx-plugin
|
||||
- docker-compose-plugin
|
||||
- python3
|
||||
Reference in New Issue
Block a user