Start working on server automation with ansible
Cette révision appartient à :
Parent
20046d9ee8
révision
b178f12bab
5 fichiers modifiés avec 41 ajouts et 0 suppressions
2
deploy/ansible/hosts
Fichier normal
2
deploy/ansible/hosts
Fichier normal
|
@ -0,0 +1,2 @@
|
||||||
|
[webservers]
|
||||||
|
127.0.0.1:2200 ansible_connection=ssh ansible_ssh_user=vagrant
|
32
deploy/ansible/roles/docker/tasks/main.yml
Fichier normal
32
deploy/ansible/roles/docker/tasks/main.yml
Fichier normal
|
@ -0,0 +1,32 @@
|
||||||
|
# TODO Get from https://download.docker.com/linux/centos/docker-ce.repo instead
|
||||||
|
# of hardcoding information here
|
||||||
|
- name: Add Docker CE repository
|
||||||
|
yum_repository:
|
||||||
|
name: docker-ce-edge
|
||||||
|
enabled: yes
|
||||||
|
description: Docker CE Edge - $basearch
|
||||||
|
baseurl: https://download.docker.com/linux/centos/7/$basearch/edge
|
||||||
|
gpgcheck: 1
|
||||||
|
gpgkey: https://download.docker.com/linux/centos/gpg
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: Install Docker CE
|
||||||
|
yum:
|
||||||
|
name: docker-ce
|
||||||
|
state: present
|
||||||
|
become: true
|
||||||
|
|
||||||
|
# TODO Make version a variable
|
||||||
|
- name: Install docker-compose
|
||||||
|
get_url:
|
||||||
|
url: "https://github.com/docker/compose/releases/download/{{ release_version }}/docker-compose-{{ ansible_system }}-{{ ansible_architecture }}"
|
||||||
|
dest: /usr/bin/docker-compose
|
||||||
|
mode: 0755
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: Enable docker at boot
|
||||||
|
systemd:
|
||||||
|
enabled: yes
|
||||||
|
name: docker
|
||||||
|
state: started
|
||||||
|
become: true
|
1
deploy/ansible/roles/docker/vars/main.yml
Fichier normal
1
deploy/ansible/roles/docker/vars/main.yml
Fichier normal
|
@ -0,0 +1 @@
|
||||||
|
release_version: 1.13.0
|
1
deploy/ansible/setup_server.retry
Fichier normal
1
deploy/ansible/setup_server.retry
Fichier normal
|
@ -0,0 +1 @@
|
||||||
|
127.0.0.1
|
5
deploy/ansible/setup_server.yml
Fichier normal
5
deploy/ansible/setup_server.yml
Fichier normal
|
@ -0,0 +1,5 @@
|
||||||
|
- name: Dotfiles
|
||||||
|
hosts: webservers
|
||||||
|
|
||||||
|
roles:
|
||||||
|
- docker
|
Référencer dans un nouveau ticket