mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-02-14 17:49:59 +00:00
- Update VMs to ubuntu/focal64 20.04 LTS (trusty64 reaced EOL on April 25 2019)
- Update Docker installation task from the [official docs](https://docs.docker.com/engine/install/ubuntu/)
This commit is contained in:
committed by
Jérôme Petazzoni
parent
73b3cad0b8
commit
64f993ff69
@@ -1,11 +1,10 @@
|
|||||||
---
|
---
|
||||||
- hosts: nodes
|
- hosts: nodes
|
||||||
sudo: true
|
become: yes
|
||||||
vars_files:
|
vars_files:
|
||||||
- vagrant.yml
|
- vagrant.yml
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
- name: clean up the home folder
|
- name: clean up the home folder
|
||||||
file:
|
file:
|
||||||
path: /home/vagrant/{{ item }}
|
path: /home/vagrant/{{ item }}
|
||||||
@@ -24,25 +23,23 @@
|
|||||||
|
|
||||||
- name: installing dependencies
|
- name: installing dependencies
|
||||||
apt:
|
apt:
|
||||||
name: apt-transport-https,ca-certificates,python-pip,tmux
|
name: apt-transport-https,ca-certificates,python3-pip,tmux
|
||||||
state: present
|
state: present
|
||||||
update_cache: true
|
update_cache: true
|
||||||
|
|
||||||
- name: fetching docker repo key
|
- name: fetching docker repo key
|
||||||
apt_key:
|
apt_key:
|
||||||
keyserver: hkp://p80.pool.sks-keyservers.net:80
|
url: https://download.docker.com/linux/ubuntu/gpg
|
||||||
id: 58118E89F3A912897C070ADBF76221572C52609D
|
state: present
|
||||||
|
|
||||||
- name: adding package repos
|
- name: adding docker repo
|
||||||
apt_repository:
|
apt_repository:
|
||||||
repo: "{{ item }}"
|
repo: deb https://download.docker.com/linux/ubuntu focal stable
|
||||||
state: present
|
state: present
|
||||||
with_items:
|
|
||||||
- deb https://apt.dockerproject.org/repo ubuntu-trusty main
|
|
||||||
|
|
||||||
- name: installing docker
|
- name: installing docker
|
||||||
apt:
|
apt:
|
||||||
name: docker-engine
|
name: docker-ce,docker-ce-cli,containerd.io,docker-compose-plugin
|
||||||
state: present
|
state: present
|
||||||
update_cache: true
|
update_cache: true
|
||||||
|
|
||||||
@@ -56,7 +53,7 @@
|
|||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /etc/default/docker
|
dest: /etc/default/docker
|
||||||
line: DOCKER_OPTS="--host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:55555"
|
line: DOCKER_OPTS="--host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:55555"
|
||||||
regexp: '^#?DOCKER_OPTS=.*$'
|
regexp: "^#?DOCKER_OPTS=.*$"
|
||||||
state: present
|
state: present
|
||||||
register: docker_opts
|
register: docker_opts
|
||||||
|
|
||||||
@@ -66,22 +63,14 @@
|
|||||||
state: restarted
|
state: restarted
|
||||||
when: docker_opts is defined and docker_opts.changed
|
when: docker_opts is defined and docker_opts.changed
|
||||||
|
|
||||||
- name: performing pip autoupgrade
|
- name: install docker-compose from official github repo
|
||||||
pip:
|
get_url:
|
||||||
name: pip
|
url: https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64
|
||||||
state: latest
|
dest: /usr/local/bin/docker-compose
|
||||||
|
mode: "u+x,g+x"
|
||||||
- name: installing virtualenv
|
|
||||||
pip:
|
|
||||||
name: virtualenv
|
|
||||||
state: latest
|
|
||||||
|
|
||||||
- name: Install Docker Compose via PIP
|
|
||||||
pip: name=docker-compose
|
|
||||||
|
|
||||||
- name:
|
- name:
|
||||||
file:
|
file: path="/usr/local/bin/docker-compose"
|
||||||
path="/usr/local/bin/docker-compose"
|
|
||||||
state=file
|
state=file
|
||||||
mode=0755
|
mode=0755
|
||||||
owner=vagrant
|
owner=vagrant
|
||||||
@@ -128,5 +117,3 @@
|
|||||||
line: "127.0.0.1 localhost {{ inventory_hostname }}"
|
line: "127.0.0.1 localhost {{ inventory_hostname }}"
|
||||||
- regexp: '^127\.0\.1\.1'
|
- regexp: '^127\.0\.1\.1'
|
||||||
line: "127.0.1.1 {{ inventory_hostname }}"
|
line: "127.0.1.1 {{ inventory_hostname }}"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
---
|
---
|
||||||
vagrant:
|
vagrant:
|
||||||
default_box: ubuntu/trusty64
|
default_box: ubuntu/focal64
|
||||||
default_box_check_update: true
|
default_box_check_update: true
|
||||||
ssh_insert_key: false
|
ssh_insert_key: false
|
||||||
min_memory: 256
|
min_memory: 256
|
||||||
min_cores: 1
|
min_cores: 1
|
||||||
|
|
||||||
instances:
|
instances:
|
||||||
|
|
||||||
- hostname: node1
|
- hostname: node1
|
||||||
private_ip: 10.10.10.10
|
private_ip: 10.10.10.10
|
||||||
memory: 1512
|
memory: 1512
|
||||||
@@ -37,6 +36,3 @@ instances:
|
|||||||
private_ip: 10.10.10.50
|
private_ip: 10.10.10.50
|
||||||
memory: 512
|
memory: 512
|
||||||
cores: 1
|
cores: 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user