Utilisation en local seulement.

This commit is contained in:
William 2021-05-24 13:46:09 +02:00
parent 41e875c623
commit f0bfa66eae
4 changed files with 9 additions and 9 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
hosts
/playbook.retry

View File

@ -1,2 +0,0 @@
[webservers]
server.example.org ansible_user=ubuntu

View File

@ -1,7 +1,8 @@
---
- name: Setup docker
hosts: webservers
- name: Setup docker on localhost
hosts: localhost
connection: local
become: yes
tasks:
@ -19,12 +20,12 @@
- name: Add Docker GPG apt Key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
url: https://download.docker.com/linux/debian/gpg
state: present
- name: Add Docker 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
- name: Update apt and install docker-ce
@ -46,6 +47,6 @@
- name: Add user to docker group
user:
name: ubuntu
name: "{{ ansible_user }}"
groups: docker
append: yes

View File

@ -1,5 +1,5 @@
# Playbook d'installation de docker
# Playbook d'installation de docker en local
```
ansible-playbook -i hosts playbook.yml
ansible-playbook playbook.yml
```