You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
algo/non-cloud.yml

59 lines
1.5 KiB
YAML

- hosts: localhost
gather_facts: False
vars_files:
8 years ago
- config.cfg
vars_prompt:
8 years ago
- name: "server_ip"
prompt: "Enter IP address of your server:\n"
private: no
8 years ago
- name: "server_user"
prompt: "What user should we use to login on the server?:\n"
default: "root"
private: no
8 years ago
- name: "dns_enabled"
prompt: "Do you want to use a local DNS resolver to block ads while surfing? (Y or N):\n"
default: "Y"
private: no
8 years ago
- name: "auditd_enabled"
prompt: "Do you want to use auditd ? (Y or N):\n"
default: "Y"
8 years ago
private: no
tasks:
- name: Add the server to the vpn-host group
8 years ago
add_host:
hostname: "{{ server_ip }}"
groupname: vpn-host
ansible_ssh_user: "{{ server_user }}"
ansible_python_interpreter: "/usr/bin/python2.7"
dns_enabled: "{{ dns_enabled }}"
auditd_enabled: " {{ auditd_enabled }}"
- name: Wait for SSH to become available
local_action: "wait_for port=22 host={{ server_ip }} timeout=320"
become: false
8 years ago
- name: Post-provisioning tasks
hosts: vpn-host
gather_facts: false
become: true
vars_files:
- config.cfg
8 years ago
pre_tasks:
- name: Install prerequisites
raw: sudo apt-get update -qq && sudo apt-get install -qq -y python2.7
- name: Configure defaults
8 years ago
raw: sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
roles:
- common
- security
- features
- vpn
8 years ago
- { role: logging, when: auditd_enabled is defined and auditd_enabled == 'Y' }