-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-environment.yaml
More file actions
155 lines (141 loc) · 3.88 KB
/
deploy-environment.yaml
File metadata and controls
155 lines (141 loc) · 3.88 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
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
- name: Pre-requirements on all hosts
hosts: all
tasks:
- import_tasks: ansible/tasks/output_dir.yaml
- snap:
name: yq
become: true
- apt:
name: jq
become: true
- name: Install and configure LXD on the host.
hosts: localhost
become: true
tasks:
- import_role:
name: ansible/roles/lxd
- name: Configure the LXD networks and storage pool.
hosts: localhost
tasks:
- import_role:
name: ansible/roles/lxd
tasks_from: terraform-resources.yaml
- name: Deploy MAAS server
hosts: localhost
become: true
roles:
- role: ansible/roles/maas
vars:
maas_user: "{{ maas.user }}"
maas_password: "{{ maas.password }}"
- name: Add MAAS client to localhost
hosts: localhost
tasks:
- name: Login to MAAS
import_role:
name: ansible/roles/maas
tasks_from: login.yaml
vars:
maas_user: "{{ maas.user }}"
- name: Skip MAAS intro
hosts: localhost
tasks:
- shell: maas {{ maas.user }} maas set-config name=completed_intro value=true
- name: Register LXD VM host on MAAS
hosts: localhost
tasks:
- import_role:
name: ansible/roles/maas
tasks_from: add-lxd-vm-host.yaml
vars:
name: hypervisor
maas_user: "{{ maas.user }}"
lxd_address: "{{ maas_ip }}:8443"
- name: Configure the DNS in MAAS
hosts: localhost
tasks:
- import_role:
name: ansible/roles/maas
tasks_from: configure-dns.yaml
- name: Configure the networks in MAAS
hosts: localhost
tasks:
- name: "Configure network on MAAS"
include_role:
name: ansible/roles/maas
tasks_from: configure-network.yaml
vars:
network: "{{ item }}"
with_items: "{{ networks }}"
- name: Configure the Ubuntu images on MAAS
hosts: localhost
tasks:
- include_role:
name: ansible/roles/maas
tasks_from: configure-boot-source-selections.yaml
vars:
release: "{{ item }}"
with_items: "{{ ubuntu_series }}"
- name: Configure the MAAS cloud in Juju
hosts: localhost
tasks:
- import_role:
name: ansible/roles/juju
vars:
maas_user: "{{ maas.user }}"
maas_apikey: "{{ maas_apikey }}"
maas_url: "{{ maas_url }}"
juju_cloud: "{{ env_name }}"
juju_channel: "{{ juju.channel }}"
bootstrap_series: "{{ juju.bootstrap_series }}"
- name: Deploy the VMs
hosts: localhost
tasks:
- import_role:
name: ansible/roles/maas
tasks_from: terraform-machines.yaml
- name: Deploy Landscape
hosts: localhost
roles:
- role: ansible/roles/environments/landscape
vars:
model_series: jammy
juju_cloud: "{{ env_name }}"
admin_user: admin
admin_password: password
maas_user: "{{ maas.user }}"
- name: Generate the landscape-client overlay for the OpenStack model
hosts: localhost
tasks:
- import_role:
name: ansible/roles/environments/landscape
tasks_from: landscape-client.yaml
vars:
juju_model: openstack
client_config:
account-name: standalone
url: "https://{{ landscape_api.fqdn }}/message-system"
ping-url: "http://{{ landscape_api.fqdn }}/ping"
ssl-public-key: "base64:{{ landscape_api.ssl_ca_cert | b64encode }}"
relate_to:
- cinder
- easyrsa
- etcd
- glance
- keystone
- memcached
- mysql
- neutron-api
- nova-cloud-controller
- nova-compute
- ovn-central
- placement
- rabbitmq-server
- vault
- name: Deploy OpenStack
hosts: localhost
roles:
- role: ansible/roles/environments/openstack
vars:
vip_addr_start: "{{ networks[0].reserved_ranges[0].start }}"
extra_deploy_args: "--overlay {{ landscape_client_bundle.dest | realpath }}"