aboutsummaryrefslogtreecommitdiff
path: root/ansible
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2020-06-16 16:28:24 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2020-06-16 16:28:24 +0200
commite7ed8a49fb22e05066d3cf18f258aad0619a8e6b (patch)
tree9bd3fb02785195b8dfedae68d1254a5f6e6e311c /ansible
parent3534ba1a19844e55982cb773599671d2fdb4be02 (diff)
downloadinfrastructure-e7ed8a49fb22e05066d3cf18f258aad0619a8e6b.tar.gz
infrastructure-e7ed8a49fb22e05066d3cf18f258aad0619a8e6b.zip
Update local scripts
Diffstat (limited to 'ansible')
-rw-r--r--ansible/cluster_nodes.yml13
-rw-r--r--ansible/group_vars/all/.gitignore1
-rw-r--r--ansible/group_vars/all/vars_file.yml.sample1
-rw-r--r--ansible/roles/consul/tasks/main.yml2
-rw-r--r--ansible/roles/nomad/files/nomad.service4
-rw-r--r--ansible/roles/nomad/tasks/main.yml2
-rw-r--r--ansible/roles/storage/tasks/main.yml2
7 files changed, 14 insertions, 11 deletions
diff --git a/ansible/cluster_nodes.yml b/ansible/cluster_nodes.yml
index d36a9d6..df73e79 100644
--- a/ansible/cluster_nodes.yml
+++ b/ansible/cluster_nodes.yml
@@ -1,11 +1,16 @@
---
- hosts: cluster_nodes
+ serial: 1
roles:
- role: common
tags: base
- role: users
tags: account
+ - role: consul
+ tags: kv
+ - role: nomad
+ tags: orchestrator
# UNSAFE!! This section is disabled by default, to run it the flags -t net should be added
# to the ansible playbook command line.
@@ -18,14 +23,6 @@
- role: network
tags: [ net, never ]
-- hosts: cluster_nodes
- serial: 1
- roles:
- - role: consul
- tags: kv
- - role: nomad
- tags: orchestrator
-
# UNSAFE!! This section configures glusterfs. Once done, don't run it ever again as it may break stuff.
# - role: storage
# tags: sto
diff --git a/ansible/group_vars/all/.gitignore b/ansible/group_vars/all/.gitignore
new file mode 100644
index 0000000..9271182
--- /dev/null
+++ b/ansible/group_vars/all/.gitignore
@@ -0,0 +1 @@
+vars_file.yml
diff --git a/ansible/group_vars/all/vars_file.yml.sample b/ansible/group_vars/all/vars_file.yml.sample
new file mode 100644
index 0000000..191f35c
--- /dev/null
+++ b/ansible/group_vars/all/vars_file.yml.sample
@@ -0,0 +1 @@
+consul_gossip_encrypt: 'xxx'
diff --git a/ansible/roles/consul/tasks/main.yml b/ansible/roles/consul/tasks/main.yml
index a943022..bb1d9ef 100644
--- a/ansible/roles/consul/tasks/main.yml
+++ b/ansible/roles/consul/tasks/main.yml
@@ -1,6 +1,6 @@
- name: "Set consul version"
set_fact:
- consul_version: 1.4.0
+ consul_version: 1.7.4
- name: "Download and install Consul for armv7l"
unarchive:
diff --git a/ansible/roles/nomad/files/nomad.service b/ansible/roles/nomad/files/nomad.service
index cabfafc..34dc1fc 100644
--- a/ansible/roles/nomad/files/nomad.service
+++ b/ansible/roles/nomad/files/nomad.service
@@ -1,5 +1,9 @@
[Unit]
Description=Nomad
+After=network-online.target
+Wants=network-online.target
+After=glusterd.service
+Wants=glusterd.service
[Service]
ExecStart=/usr/local/bin/nomad agent -config /etc/nomad
diff --git a/ansible/roles/nomad/tasks/main.yml b/ansible/roles/nomad/tasks/main.yml
index e6e6e10..0b7b65c 100644
--- a/ansible/roles/nomad/tasks/main.yml
+++ b/ansible/roles/nomad/tasks/main.yml
@@ -1,6 +1,6 @@
- name: "Set nomad version"
set_fact:
- nomad_version: 0.8.6
+ nomad_version: 0.11.3
- name: "Download and install Nomad for armv7l"
unarchive:
diff --git a/ansible/roles/storage/tasks/main.yml b/ansible/roles/storage/tasks/main.yml
index 09f3a56..a1f2d8f 100644
--- a/ansible/roles/storage/tasks/main.yml
+++ b/ansible/roles/storage/tasks/main.yml
@@ -63,7 +63,7 @@
path: /mnt/glusterfs
src: "{{ private_ip }}:/donnees"
fstype: glusterfs
- opts: "defaults,_netdev"
+ opts: "defaults,_netdev,noauto,x-systemd.automount"
state: present
- name: Mount everything