This repository has been archived by the owner on May 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnm_aws_template.yml
100 lines (97 loc) · 3.24 KB
/
nm_aws_template.yml
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---
- name: get ansible information
hosts: localhost
tasks:
- name: setup
setup:
- name: Get information from user
hosts: localhost
gather_facts: false
vars_prompt:
- name: "aws_ec2_access_key"
prompt: "Enter your AWS Access Key"
default:
private: no
- name: "aws_ec2_secret_access_key"
prompt: "Enter your AWS Secret Access Key"
default:
private: no
- name: "aws_ec2_region"
prompt: "Enter your AWS region"
default: eu-west-1
private: no
- name: "aws_ssh_user"
prompt: "Enter the SSH User of the Instance"
default: ec2-user
private: no
- name: "aws_ssh_key_name"
prompt: "Enter the name for the SSH Key"
default: mockfog.pem
private: no
- name: "nm_aws_name"
prompt: "Enter the name for the NodeManager VM"
default: MockFog_manager
private: no
- name: "nm_aws_image"
prompt: "Enter the AMI for the NodeManager VM"
default: ami-0bdb1d6c15a40392c
private: no
- name: "nm_aws_flavor"
prompt: "Enter the Profile for the NodeManager VM"
default: t2.small
private: no
roles:
- manager-bootstrap
post_tasks:
- set_fact:
aws_ec2_access_key: "{{ aws_ec2_access_key }}"
aws_ec2_secret_access_key: "{{ aws_ec2_secret_access_key }}"
aws_ec2_region: "{{ aws_ec2_region }}"
aws_ssh_user: "{{ aws_ssh_user }}"
aws_ssh_key_name: "{{ aws_ssh_key_name }}"
network_aws_vpc_name: "{{ network_aws_vpc_name }}"
network_aws_vpc_cidr: "{{ network_aws_vpc_cidr }}"
network_aws_mgmt_subnet_name: "{{ network_aws_mgmt_subnet_name }}"
network_aws_mgmt_cidr: "{{ network_aws_mgmt_cidr }}"
nm_aws_name: "{{ nm_aws_name }}"
nm_aws_image: "{{ nm_aws_image }}"
nm_aws_flavor: "{{ nm_aws_flavor }}"
tags: bootstrap
vars:
local:
cloud: aws
- name: Wait for NodeManager Node to be ready
hosts: MockFog_NM
gather_facts: false
tasks:
- local_action:
module: wait_for
host: "{{ inventory_hostname }}"
port: 22
delay: 5
timeout: 60
tags: bootstrap
- name: Install Nodemanager
hosts: MockFog_NM
become: yes
gather_facts: false
# debugger: always
roles:
- manager-install
vars_files:
- repositories.yml
vars:
local:
cloud: aws
aws_ec2_access_key: "{{ hostvars['localhost']['aws_ec2_access_key'] }}"
aws_ec2_secret_access_key: "{{ hostvars['localhost']['aws_ec2_secret_access_key'] }}"
aws_ec2_region: "{{ hostvars['localhost']['aws_ec2_region'] }}"
aws_ssh_user: "{{ hostvars['localhost']['aws_ssh_user'] }}"
aws_ssh_key_name: "{{ hostvars['localhost']['aws_ssh_key_name'] }}"
network_aws_vpc_name: "{{ hostvars['localhost']['network_aws_vpc_name'] }}"
network_aws_vpc_cidr: "{{ hostvars['localhost']['network_aws_vpc_cidr'] }}"
network_aws_mgmt_subnet_name: "{{ hostvars['localhost']['network_aws_mgmt_subnet_name'] }}"
network_aws_mgmt_cidr: "{{ hostvars['localhost']['network_aws_mgmt_cidr'] }}"
nm_aws_name: "{{ hostvars['localhost']['nm_aws_name'] }}"
nm_aws_image: "{{ hostvars['localhost']['nm_aws_image'] }}"
nm_aws_flavor: "{{ hostvars['localhost']['nm_aws_flavor'] }}"