Skip to content

Commit

Permalink
Docker installation
Browse files Browse the repository at this point in the history
  • Loading branch information
diegotony committed Mar 13, 2022
1 parent 5ead71c commit 45a7fdb
Show file tree
Hide file tree
Showing 15 changed files with 65 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ Script created with Ansible
- Python version manager
- Amazon CLI and SAM
- ohMyZSH


# Run
```bash
ansible-playbook playbook.yml
```
3 changes: 2 additions & 1 deletion playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
become: yes
roles:
# - common
- hashicorp
# - hashicorp
- docker
2 changes: 2 additions & 0 deletions q
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
deb [arch=amd64] ttps://download.docker.com/linux/debian bullseye main
deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable
Empty file added roles/docker/defaults/main.yml
Empty file.
1 change: 1 addition & 0 deletions roles/docker/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- include: services.yml
Empty file.
Empty file added roles/docker/meta/main.yml
Empty file.
Empty file added roles/docker/tasks/config.yml
Empty file.
14 changes: 14 additions & 0 deletions roles/docker/tasks/dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- name: Install docker packages
apt:
update_cache: yes
name: "{{item}}"
state: present

with_items:
- ca-certificates
- curl
- gnupg
- lsb-release
- apt-transport-https
register: dependencies

4 changes: 4 additions & 0 deletions roles/docker/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- include: dependencies.yml
- include: repository.yml
- include: config.yml
- include: post.yml
11 changes: 11 additions & 0 deletions roles/docker/tasks/post.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
- name: Ensure group docker exists
ansible.builtin.group:
name: docker
state: present

- name: Adding existing user kakashi to group sudo
user:
name: kakashi
groups: docker
append: yes
# become: yes
24 changes: 24 additions & 0 deletions roles/docker/tasks/repository.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
- name: import the docker apt key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
become: true

- name: Add docker repository into sources list
ansible.builtin.apt_repository:
repo: "deb [arch=amd64] https://download.docker.com/linux/debian {{ansible_distribution_release}} stable"
state: present
filename: docker

- name: Install Docker Packages
apt:
update_cache: yes
name: "{{item}}"
state: present
become_user: root
with_items:
- docker-ce
- docker-ce-cli
- containerd.io
register: packages

Empty file added roles/docker/templates/main.yml
Empty file.
Empty file added roles/docker/vars/main.yml
Empty file.
2 changes: 1 addition & 1 deletion roles/hashicorp/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# - include: dependencies.yml
- include: dependencies.yml
- include: repository.yml
- include: config.yml

0 comments on commit 45a7fdb

Please sign in to comment.