forked from Tendrl/tendrl-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsite.yml.sample
88 lines (77 loc) · 2.66 KB
/
site.yml.sample
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
# This is an example of a ansible playbook to install Tendrl, automating steps
# from upstream *Tendrl Package Installation Reference*. You need to review it
# and either tweak it or use it as a starting point before installing
# Tendrl.
# The playbook expects inventory file with the following groups:
#
# * tendrl-server: a single machine where Tendrl Server (management console) is
# installed
# * gluster-servers: gluster storage servers (machines with bricks)
#
# Note that this is just an example which holds for this playbook, tendrl roles
# doesn't care how you group your servers in ansible inventory.
#
# Validation of prerequisities for Tendrl, doesn't modify machines in any way.
#
- include: prechecks.yml
#
# Workarounds required to run before the installation.
#
- include: workaround.disable-firewall.yml
#
# Run yum update.
#
- hosts: all
user: root
tasks:
- name: Update all installed packages
yum:
name: '*'
state: latest
#
# Installation of Tendrl itself.
#
- hosts: tendrl-server
user: root
# When you uncomment this here (eg. because you are using sudo to switch to
# root user account on the remote machines, make sure you change it in all
# playbooks in this directory as well)
# become: yes
vars:
# You need to specify fqdn where etcd will be listening, either by
# value based on prior knowledge of your infrastructure:
# etcd_fqdn: 'tendrl.example.com'
# or using ansible facts: fqdn of tendrl-server as detected by ansible:
etcd_fqdn: "{{ ansible_fqdn }}"
# Moreover you need to use ip address of interface where etcd will be
# listening, to configure etcd itself.
etcd_ip_address: "{{ lookup('dig', ansible_fqdn) }}"
# fqdn of graphite instance (carbon-cache service in particular) which will
# be used in tendrl config files (this value doesn't reconfigure
# graphite).
# Note that a safe default value for fqdn of graphite is the same one
# we use for etcd here (tendrl-server role places both services on the same
# machine).
graphite_fqdn: "{{ etcd_fqdn }}"
pre_tasks:
- name: Check that variables are defined properly (just to make this clear)
assert:
that:
- etcd_fqdn is defined
- etcd_ip_address is defined
- graphite_fqdn is defined
roles:
- grafana-repo
- tendrl-copr
- tendrl-server
- hosts: gluster-servers
user: root
# become: yes
vars:
# make sure this value is the same
etcd_fqdn: "{{ hostvars[groups['tendrl-server'][0]].ansible_fqdn }}"
graphite_fqdn: "{{ hostvars[groups['tendrl-server'][0]].ansible_fqdn }}"
roles:
- tendrl-copr
- tendrl-storage-node