mirror of
https://github.com/geerlingguy/ansible-for-devops.git
synced 2024-05-19 06:50:03 +00:00
18 lines
624 B
YAML
18 lines
624 B
YAML
---
|
|
# You can add users to the docker group to allow them to manage docker
|
|
# containers. This playbook uses sudo rather than the vagrant user because
|
|
# Ansible uses ControlPersist for SSH connections. The first time this playbook
|
|
# runs, the docker commands would fail if run by the vagrant user, since the
|
|
# persisted connection state isn't aware of the addition of the 'docker' group.
|
|
- name: Add vagrant user to docker group.
|
|
user:
|
|
name: vagrant
|
|
groups: docker
|
|
append: true
|
|
|
|
- name: Install Pip.
|
|
apt: name=python3-pip state=present
|
|
|
|
- name: Install Docker Python library.
|
|
pip: name=docker state=present
|