You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.0 KiB
48 lines
1.0 KiB
5 years ago
|
---
|
||
5 years ago
|
- name: Load in local SSH key path
|
||
|
set_fact:
|
||
|
my_ssh_key: "/root/.ssh/id_rsa.pub"
|
||
|
|
||
|
- name: Local user has an SSH key
|
||
|
command: stat {{ my_ssh_key }}
|
||
|
changed_when: false
|
||
|
run_once: true
|
||
|
|
||
5 years ago
|
- name: Install python-apt to use ansible apt module
|
||
|
shell: apt update && apt install -y python-apt
|
||
|
|
||
|
- name: Ensure python and other dependencies are installed.
|
||
|
apt:
|
||
|
name:
|
||
|
- apt-transport-https
|
||
|
- ca-certificates
|
||
|
- gnupg
|
||
|
- python-pip
|
||
|
#- python-docker
|
||
|
state: present
|
||
|
|
||
|
- name: pip install docker
|
||
|
pip:
|
||
|
name: docker
|
||
|
state: present
|
||
|
|
||
|
- name: Add docker gpg key
|
||
|
#shell: wget https://download.docker.com/linux/debian/gpg -O - | apt-key add -
|
||
|
apt_key:
|
||
|
url: "https://download.docker.com/linux/debian/gpg"
|
||
|
state: present
|
||
|
|
||
|
- name: Add docker stable repository for debian
|
||
|
apt_repository:
|
||
|
repo: "deb https://download.docker.com/linux/debian stretch stable"
|
||
|
state: present
|
||
|
|
||
|
- name: Install lxc & docker
|
||
|
apt:
|
||
|
name:
|
||
|
- lxc
|
||
|
- docker
|
||
|
- docker-ce
|
||
|
- python-lxc
|
||
|
notify: Restart docker
|