[TIDY] Update to ansible 4 module names

This commit is contained in:
Jannik Beyerstedt 2021-08-28 16:50:37 +02:00
parent 3c1939f431
commit a2fc598416
19 changed files with 89 additions and 89 deletions

View file

@ -5,13 +5,13 @@
# Detect some more host facts
- name: docker - Detect architecture
shell: dpkg --print-architecture
ansible.builtin.shell: dpkg --print-architecture
register: dpkg_arch
# Install docker CE
- name: docker - Install docker CE APT dependencies
become: yes
apt:
ansible.builtin.apt:
name: "{{ packages }}"
state: present
vars:
@ -23,27 +23,27 @@
- software-properties-common
- name: docker - Add docker CE repo key
become: yes
apt_key:
ansible.builtin.apt_key:
url: https://download.docker.com/linux/debian/gpg
state: present
# IMPORTANT: raspbian needs deb [arch=armhf] https://download.docker.com/linux/raspbian ...
- name: docker - Add docker CE repo (Debian)
become: yes
apt_repository:
ansible.builtin.apt_repository:
repo: "deb [arch={{ dpkg_arch.stdout }}] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable"
state: present
when: ansible_facts['lsb']['id'] != "Raspbian"
- name: docker - Add docker CE repo (Raspbian)
become: yes
apt_repository:
ansible.builtin.apt_repository:
repo: "deb [arch={{ dpkg_arch.stdout }}] https://download.docker.com/linux/raspbian {{ ansible_distribution_release }} stable"
state: present
when: ansible_facts['lsb']['id'] == "Raspbian"
- name: docker - Install docker CE
become: yes
apt:
ansible.builtin.apt:
name: docker-ce
state: latest
install_recommends: no
@ -54,14 +54,14 @@
# docker only provides pre-compiled binaries for x86_64, but not for armhf/ arm64!
# but ansible needs the python package anyway
- name: docker-compose - Discover if ARM is used
set_fact:
ansible.builtin.set_fact:
dockercompose_use_pip: true
when: ansible_architecture == "aarch64" or ansible_architecture == "armv7l"
- name: docker-compose - Install x86_46 binary
block:
- name: docker-compose - Get version number of stable
shell: |
ansible.builtin.shell: |
curl -s https://api.github.com/repos/docker/compose/releases/latest \
| grep tag_name \
| cut -d '"' -f 4
@ -70,13 +70,13 @@
register: latest_dc_version
- name: docker-compose - Download and install
become: yes
get_url:
ansible.builtin.get_url:
url: "https://github.com/docker/compose/releases/download/{{ latest_dc_version.stdout }}/docker-compose-Linux-x86_64"
dest: /usr/local/bin/docker-compose
force: yes # otherwise updates will not be downloaded
- name: docker-compose - Make docker-compose executable
become: yes
file:
ansible.builtin.file:
path: /usr/local/bin/docker-compose
mode: 0755
when: dockercompose_use_pip == false and ansible_architecture == "x86_64"
@ -84,7 +84,7 @@
block:
- name: docker-compose - Install requirements
become: yes
apt:
ansible.builtin.apt:
name: "{{ packages }}"
state: present
vars:
@ -93,7 +93,7 @@
- python3-setuptools
- name: docker-compose - Install using pip3
become: yes
pip:
ansible.builtin.pip:
name: docker-compose
executable: pip3
when: dockercompose_use_pip == true