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 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 - 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

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
``` ```