Skip to content

Instantly share code, notes, and snippets.

@ArKam
Created November 10, 2016 10:43
Show Gist options
  • Save ArKam/e0f91da6a4e3bfb14d15f49dbc8e8548 to your computer and use it in GitHub Desktop.
Save ArKam/e0f91da6a4e3bfb14d15f49dbc8e8548 to your computer and use it in GitHub Desktop.
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
---
# 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