@@ -1,2 +0,0 @@
|
|||||||
---
|
|
||||||
# defaults file for docker
|
|
@@ -1,2 +0,0 @@
|
|||||||
---
|
|
||||||
# handlers file for docker
|
|
@@ -1,18 +0,0 @@
|
|||||||
# ===================================================================================================
|
|
||||||
# ? ABOUT
|
|
||||||
# @author : Noah Knegt
|
|
||||||
# @email : personal@noahknegt.com
|
|
||||||
# @repo : https://git.noahknegt.com/noah.knegt/ansible-automations
|
|
||||||
# @createdOn : 31-03-2023
|
|
||||||
# @description : This will add selected users to the docker group.
|
|
||||||
# ===================================================================================================
|
|
||||||
|
|
||||||
---
|
|
||||||
- name: Add users to the docker group
|
|
||||||
become: true
|
|
||||||
user:
|
|
||||||
name: "{{ item }}"
|
|
||||||
groups: docker
|
|
||||||
append: true
|
|
||||||
with_items: "{{ docker_users }}"
|
|
||||||
when: docker_users is defined
|
|
@@ -1,24 +0,0 @@
|
|||||||
# ===================================================================================================
|
|
||||||
# ? ABOUT
|
|
||||||
# @author : Noah Knegt
|
|
||||||
# @email : personal@noahknegt.com
|
|
||||||
# @repo : https://git.noahknegt.com/noah.knegt/ansible-automations
|
|
||||||
# @createdOn : 06-04-2023
|
|
||||||
# @description : This will make sure that docker buildx is installed.
|
|
||||||
# ===================================================================================================
|
|
||||||
|
|
||||||
---
|
|
||||||
- name: Check for docker-buildx
|
|
||||||
shell: docker buildx version
|
|
||||||
register: docker_buildx
|
|
||||||
ignore_errors: true
|
|
||||||
|
|
||||||
- name: Install docker-buildx
|
|
||||||
package:
|
|
||||||
name: docker-buildx
|
|
||||||
state: present
|
|
||||||
when: docker_buildx.stdout is not defined
|
|
||||||
|
|
||||||
- name: Alias docker-buildx
|
|
||||||
shell: docker buildx install
|
|
||||||
when: docker_buildx.stdout is not defined
|
|
@@ -1,29 +0,0 @@
|
|||||||
# ===================================================================================================
|
|
||||||
# ? ABOUT
|
|
||||||
# @author : Noah Knegt
|
|
||||||
# @email : personal@noahknegt.com
|
|
||||||
# @repo : https://git.noahknegt.com/noah.knegt/ansible-automations
|
|
||||||
# @createdOn : 31-03-2023
|
|
||||||
# @description : This will check if docker is installed as the latest version.
|
|
||||||
# ===================================================================================================
|
|
||||||
|
|
||||||
---
|
|
||||||
- name: Check docker version
|
|
||||||
shell: docker --version
|
|
||||||
register: docker_version
|
|
||||||
ignore_errors: true
|
|
||||||
|
|
||||||
- name: Install jq
|
|
||||||
become: true
|
|
||||||
package:
|
|
||||||
name: jq
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Check if latest version is stable
|
|
||||||
shell: "curl -s https://api.github.com/repos/docker/cli/tags | jq -r '.[0].name' | grep -E -o '[0-9]+\\.[0-9]+\\.[0-9]+\\-?'"
|
|
||||||
register: docker_latest_version
|
|
||||||
|
|
||||||
- name: Compare versions
|
|
||||||
set_fact:
|
|
||||||
docker_update: true
|
|
||||||
when: docker_version.stdout is not defined
|
|
@@ -1,14 +0,0 @@
|
|||||||
# ===================================================================================================
|
|
||||||
# ? ABOUT
|
|
||||||
# @author : Noah Knegt
|
|
||||||
# @email : personal@noahknegt.com
|
|
||||||
# @repo : https://git.noahknegt.com/noah.knegt/ansible-automations
|
|
||||||
# @createdOn : 31-03-2023
|
|
||||||
# @description : This will cleanup the docker script from the machine.
|
|
||||||
# ===================================================================================================
|
|
||||||
|
|
||||||
---
|
|
||||||
- name: Cleanup docker script
|
|
||||||
file:
|
|
||||||
path: /tmp/get-docker.sh
|
|
||||||
state: absent
|
|
@@ -1,15 +0,0 @@
|
|||||||
# ===================================================================================================
|
|
||||||
# ? ABOUT
|
|
||||||
# @author : Noah Knegt
|
|
||||||
# @email : personal@noahknegt.com
|
|
||||||
# @repo : https://git.noahknegt.com/noah.knegt/ansible-automations
|
|
||||||
# @createdOn : 31-03-2023
|
|
||||||
# @description : This will download the docker install script.
|
|
||||||
# ===================================================================================================
|
|
||||||
|
|
||||||
---
|
|
||||||
- name: Download the docker install script
|
|
||||||
get_url:
|
|
||||||
url: https://get.docker.com
|
|
||||||
dest: /tmp/get-docker.sh
|
|
||||||
mode: 0755
|
|
@@ -1,13 +0,0 @@
|
|||||||
# ===================================================================================================
|
|
||||||
# ? ABOUT
|
|
||||||
# @author : Noah Knegt
|
|
||||||
# @email : personal@noahknegt.com
|
|
||||||
# @repo : https://git.noahknegt.com/noah.knegt/ansible-automations
|
|
||||||
# @createdOn : 31-03-2023
|
|
||||||
# @description : This will install the docker engine.
|
|
||||||
# ===================================================================================================
|
|
||||||
|
|
||||||
---
|
|
||||||
- name: Run the docker install script
|
|
||||||
shell: /tmp/get-docker.sh
|
|
||||||
when: docker_update is defined
|
|
@@ -1,25 +0,0 @@
|
|||||||
# ===================================================================================================
|
|
||||||
# ? ABOUT
|
|
||||||
# @author : Noah Knegt
|
|
||||||
# @email : personal@noahknegt.com
|
|
||||||
# @repo : https://git.noahknegt.com/noah.knegt/ansible-automations
|
|
||||||
# @createdOn : 27-03-2023
|
|
||||||
# @description : This will make sure that docker is installed on the machine.
|
|
||||||
# ===================================================================================================
|
|
||||||
|
|
||||||
---
|
|
||||||
- include_tasks: check_version.yml
|
|
||||||
|
|
||||||
- include_tasks: download.yml
|
|
||||||
when: docker_update is defined
|
|
||||||
|
|
||||||
- include_tasks: install.yml
|
|
||||||
when: docker_update is defined
|
|
||||||
|
|
||||||
- include_tasks: addusers.yml
|
|
||||||
when: docker_update is defined
|
|
||||||
|
|
||||||
- include_tasks: cleanup.yml
|
|
||||||
when: docker_update is defined
|
|
||||||
|
|
||||||
- include_tasks: buildx.yml
|
|
@@ -1,2 +0,0 @@
|
|||||||
localhost
|
|
||||||
|
|
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
- hosts: localhost
|
|
||||||
remote_user: root
|
|
||||||
roles:
|
|
||||||
- docker
|
|
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
# vars file for docker
|
|
||||||
docker_users:
|
|
||||||
- noahk
|
|
||||||
- root
|
|
Reference in New Issue
Block a user