Utilisation en local seulement.
This commit is contained in:
parent
41e875c623
commit
f0bfa66eae
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
hosts
|
hosts
|
||||||
|
/playbook.retry
|
||||||
|
|||||||
@ -1,2 +0,0 @@
|
|||||||
[webservers]
|
|
||||||
server.example.org ansible_user=ubuntu
|
|
||||||
11
playbook.yml
11
playbook.yml
@ -1,7 +1,8 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: Setup docker
|
- name: Setup docker on localhost
|
||||||
hosts: webservers
|
hosts: localhost
|
||||||
|
connection: local
|
||||||
become: yes
|
become: yes
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
@ -19,12 +20,12 @@
|
|||||||
|
|
||||||
- name: Add Docker GPG apt Key
|
- name: Add Docker GPG apt Key
|
||||||
apt_key:
|
apt_key:
|
||||||
url: https://download.docker.com/linux/ubuntu/gpg
|
url: https://download.docker.com/linux/debian/gpg
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Add Docker Repository
|
- name: Add Docker Repository
|
||||||
apt_repository:
|
apt_repository:
|
||||||
repo: deb https://download.docker.com/linux/ubuntu focal stable
|
repo: deb https://download.docker.com/linux/debian buster stable
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Update apt and install docker-ce
|
- name: Update apt and install docker-ce
|
||||||
@ -46,6 +47,6 @@
|
|||||||
|
|
||||||
- name: Add user to docker group
|
- name: Add user to docker group
|
||||||
user:
|
user:
|
||||||
name: ubuntu
|
name: "{{ ansible_user }}"
|
||||||
groups: docker
|
groups: docker
|
||||||
append: yes
|
append: yes
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user