Created
November 10, 2016 10:43
-
-
Save ArKam/e0f91da6a4e3bfb14d15f49dbc8e8548 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
consul: | |
root_url: https://releases.hashicorp.com/consul | |
version: 0.7.0 | |
services: | |
- server: | |
archive: consul_0.7.0_linux_amd64.zip | |
dir: /usr/local/bin/ | |
- webui: | |
archive: consul_0.7.0_web_ui.zip | |
dir: /var/www/html/consul-ui/ | |
account: | |
user: consul | |
group: consul | |
system: yes | |
shell: /usr/sbin/nologin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# Installing consul, creating directories and pre-requirements. | |
- name: Installing pre-requirements. | |
package: | |
name: unzip | |
state: present | |
- name: Creating user and group. | |
user: | |
name: {{ item.user }} | |
group: {{ item.group }} | |
system: yes | |
state: present | |
createhome: no | |
with_items: {{ consul['account'] }} | |
- name: Creating directories. | |
file: | |
path: {{ item.1.dir }} | |
state: directory | |
owner: {{ item.0.user }} | |
group: {{ item.0.group }} | |
mode: 0750 | |
with_subelements: | |
- {{ consul['account'] }} | |
- {{ consul['services'] }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment