ansible: install docker in localhost
This commit is contained in:
parent
4e395b3843
commit
52f26cd0e0
@ -25,4 +25,53 @@
|
||||
- exa
|
||||
state: latest
|
||||
update_cache: true
|
||||
ignore_errors: yes
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Add Docker GPG apt Key
|
||||
apt_key:
|
||||
url: https://download.docker.com/linux/ubuntu/gpg
|
||||
state: present
|
||||
tags: docker
|
||||
|
||||
- name: Add Docker Repository
|
||||
apt_repository:
|
||||
repo: deb https://download.docker.com/linux/ubuntu focal stable
|
||||
state: present
|
||||
tags: docker
|
||||
|
||||
- name: Update apt and install docker-ce
|
||||
apt:
|
||||
name: docker-ce
|
||||
state: latest
|
||||
update_cache: true
|
||||
tags: docker
|
||||
|
||||
- name: Update ExecStart in Docker service file with exposing the port
|
||||
lineinfile:
|
||||
path: /lib/systemd/system/docker.service
|
||||
regexp: '^ExecStart='
|
||||
line: 'ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375'
|
||||
state: present
|
||||
tags: docker, config
|
||||
|
||||
- name: Reload systemd to apply changes
|
||||
command: systemctl daemon-reload
|
||||
tags: config
|
||||
|
||||
- name: Start and enable Docker
|
||||
service:
|
||||
name: docker
|
||||
state: started
|
||||
enabled: yes
|
||||
tags: docker
|
||||
|
||||
- name: Create a login user
|
||||
user:
|
||||
name: "tylen"
|
||||
password: "$6$OhH/TOtjPdxJgC9i$1ytWcV0yBuv5b4Momkka57tErCc4UqvG0zqydyyGQm3OXSaWPHTLHxvPjeCdA9B8T0./eXawj62xZ7gVtzokG/"
|
||||
groups:
|
||||
- docker
|
||||
- sudo
|
||||
state: present
|
||||
shell: /usr/bin/zsh
|
||||
tags: login
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user