forked from rok/awshub
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsite.yaml
More file actions
executable file
·44 lines (38 loc) · 1.06 KB
/
Copy pathsite.yaml
File metadata and controls
executable file
·44 lines (38 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env ansible-playbook
---
- name: Provision an EC2 instance
hosts: localhost
connection: local
gather_facts: no
roles:
- provision_ec2
- userlist
post_tasks:
- name: Refresh EC2 inventory
shell: inventory/ec2.py --refresh-cache
- meta: refresh_inventory
- name: Create cookie_secret
shell: openssl rand -hex 1024 > ./security/cookie_secret
- name: Install and configure jupyterhub on it.
hosts: "tag_Project_{{ project }}:&tag_Name_{{ project }}"
connection: ssh
user: ubuntu
become: yes
gather_facts: no
vars_files:
- "group_vars/all/all.yaml"
pre_tasks:
- name: 'Install python'
raw: sudo apt-get install -y python
- include_vars: "./userlist.yaml"
- name: Add users to the server
user: name="{{ item.username }}" password="{{ item.pwd | password_hash('sha512') }}"
with_items: "{{ users }}"
roles:
- { role: cloudflare,
when: cloudflare_token is defined and cloudflare_email is defined }
- common
- python
- supervisor
- jupyterhub
- nginx