mirror of
https://github.com/trailofbits/algo.git
synced 2025-06-07 23:53:58 +02:00
non-cloud servers #34
This commit is contained in:
parent
2078d952ae
commit
f6c1309aac
6 changed files with 68 additions and 4 deletions
|
@ -108,7 +108,6 @@
|
||||||
|
|
||||||
- name: Wait for SSH to become available
|
- name: Wait for SSH to become available
|
||||||
local_action: "wait_for port=22 host={{ inventory_hostname }} timeout=320"
|
local_action: "wait_for port=22 host={{ inventory_hostname }} timeout=320"
|
||||||
become: false
|
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- common
|
- common
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
[user-management]
|
[user-management]
|
||||||
|
52.59.88.212
|
||||||
|
|
59
non-cloud.yml
Normal file
59
non-cloud.yml
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
- hosts: localhost
|
||||||
|
gather_facts: False
|
||||||
|
vars_files:
|
||||||
|
- config.cfg
|
||||||
|
vars_prompt:
|
||||||
|
|
||||||
|
- name: "server_ip"
|
||||||
|
prompt: "Enter IP address of your server:\n"
|
||||||
|
private: no
|
||||||
|
|
||||||
|
- name: "server_user"
|
||||||
|
prompt: "What user should we use?:\n"
|
||||||
|
default: "root"
|
||||||
|
private: no
|
||||||
|
|
||||||
|
- 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
|
||||||
|
|
||||||
|
- name: "auditd_enabled"
|
||||||
|
prompt: "Do you want to use auditd ? (Y or N):\n"
|
||||||
|
default: "Y"
|
||||||
|
private: no
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- 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"
|
||||||
|
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
|
||||||
|
|
||||||
|
- name: Post-provisioning tasks
|
||||||
|
hosts: vpn-host
|
||||||
|
gather_facts: false
|
||||||
|
become: true
|
||||||
|
vars_files:
|
||||||
|
- config.cfg
|
||||||
|
|
||||||
|
pre_tasks:
|
||||||
|
- name: Install prerequisites
|
||||||
|
raw: sudo apt-get update -qq && sudo apt-get install -qq -y python2.7
|
||||||
|
- name: Configure defaults
|
||||||
|
raw: sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
|
||||||
|
|
||||||
|
roles:
|
||||||
|
- common
|
||||||
|
- security
|
||||||
|
- features
|
||||||
|
- vpn
|
||||||
|
- { role: logging, when: auditd_enabled is defined and auditd_enabled == 'Y' }
|
||||||
|
|
|
@ -73,6 +73,8 @@
|
||||||
auditd_enabled: " {{ auditd_enabled }}"
|
auditd_enabled: " {{ auditd_enabled }}"
|
||||||
with_items: "{{ ec2.instances }}"
|
with_items: "{{ ec2.instances }}"
|
||||||
|
|
||||||
- name: Wait for SSH to come up
|
- name: Wait for SSH to become available
|
||||||
wait_for: host={{ item.public_dns_name }} port=22 delay=60 timeout=320 state=started
|
local_action: "wait_for port=22 host={{ item.public_dns_name }} timeout=320"
|
||||||
with_items: "{{ ec2.instances }}"
|
with_items: "{{ ec2.instances }}"
|
||||||
|
become: false
|
||||||
|
|
||||||
|
|
3
run
3
run
|
@ -4,6 +4,8 @@ echo -n "
|
||||||
What provider would you like to use?
|
What provider would you like to use?
|
||||||
1. DigitalOcean
|
1. DigitalOcean
|
||||||
2. Amazon EC2
|
2. Amazon EC2
|
||||||
|
3. Local installation (non-cloud or a server already deployed)
|
||||||
|
|
||||||
Enter the number of your desired provider
|
Enter the number of your desired provider
|
||||||
: "
|
: "
|
||||||
|
|
||||||
|
@ -12,6 +14,7 @@ read N
|
||||||
case "$N" in
|
case "$N" in
|
||||||
1) CLOUD="digitalocean" ;;
|
1) CLOUD="digitalocean" ;;
|
||||||
2) CLOUD="ec2" ;;
|
2) CLOUD="ec2" ;;
|
||||||
|
3) CLOUD="non-cloud" ;;
|
||||||
*) exit 1 ;;
|
*) exit 1 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue