algo/users.yml

72 lines
1.8 KiB
YAML
Raw Normal View History

2016-07-27 21:27:11 +00:00
---
2016-08-11 20:54:29 +00:00
- hosts: localhost
gather_facts: False
2017-05-08 20:34:45 +00:00
tags: always
2016-08-11 20:54:29 +00:00
vars_files:
2016-08-16 03:32:44 +00:00
- config.cfg
2016-08-11 20:54:29 +00:00
tasks:
- block:
- name: Add the server to the vpn-host group
add_host:
hostname: "{{ server_ip }}"
groupname: vpn-host
ansible_ssh_user: "{{ server_user }}"
ansible_python_interpreter: "/usr/bin/python2.7"
ssh_tunneling_enabled: "{{ ssh_tunneling_enabled }}"
easyrsa_CA_password: "{{ easyrsa_CA_password }}"
2017-06-08 14:27:35 +00:00
IP_subject: "{{ IP_subject_alt_name }}"
ansible_ssh_private_key_file: "{{ SSH_keys.private }}"
- name: Wait until SSH becomes ready...
local_action:
module: wait_for
port: 22
host: "{{ server_ip }}"
search_regex: "OpenSSH"
delay: 10
timeout: 320
state: present
become: false
rescue:
- debug: var=fail_hint
tags: always
- fail:
tags: always
2016-08-11 20:54:29 +00:00
2016-07-30 17:26:30 +00:00
- name: User management
2016-08-11 20:54:29 +00:00
hosts: vpn-host
gather_facts: true
2016-07-30 16:05:04 +00:00
become: true
2016-07-27 21:27:11 +00:00
vars_files:
2016-08-16 03:32:44 +00:00
- config.cfg
2016-08-25 20:59:16 +00:00
2016-08-18 18:49:20 +00:00
pre_tasks:
- block:
- name: Common pre-tasks
include: playbooks/common.yml
2017-05-08 20:34:45 +00:00
tags: always
rescue:
- debug: var=fail_hint
tags: always
- fail:
tags: always
roles:
2017-05-08 20:34:45 +00:00
- { role: ssh_tunneling, tags: always, when: ssh_tunneling_enabled is defined and ssh_tunneling_enabled == "y" }
- { role: vpn }
post_tasks:
- block:
- debug:
msg:
- "{{ congrats.common.split('\n') }}"
- " {% if p12.changed %}{{ congrats.p12_pass }}{% endif %}"
tags: always
rescue:
- debug: var=fail_hint
tags: always
- fail:
tags: always