-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the common roles to execute regular tasks, to avoid duplicates Signed-off-by: Yolanda Robla <[email protected]>
- Loading branch information
Showing
7 changed files
with
64 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 14 additions & 42 deletions
56
ai-deploy-cluster-singlenode/roles/create-cluster/tasks/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,15 @@ | ||
--- | ||
- name: Create a temporary file | ||
tempfile: | ||
state: file | ||
register: tempfile_pullsecret | ||
|
||
- name: Copy pull secret to file | ||
copy: | ||
content: "{{ pull_secret }}" | ||
dest: "{{ tempfile_pullsecret.path }}" | ||
|
||
- name: Create cluster and download ISO | ||
block: | ||
- name: Create new AI cluster | ||
shell: "aicli create cluster -P pull_secret={{ tempfile_pullsecret.path }} -P base_dns_domain={{ cluster_domain }} -P ssh_public_key='{{ ssh_public_key }}' -P high_availability_mode=None -P openshift_version='{{ cluster_version }}' {{ cluster_name }}" | ||
|
||
- name: Retrieve cluster ID from name | ||
shell: "aicli list cluster | grep {{ cluster_name }} | cut -d '|' -f3 | tr -d ' '" | ||
register: cluster_id | ||
|
||
- name: Set the right network type | ||
uri: | ||
url: "{{ ai_url }}/api/assisted-install/v1/clusters/{{ cluster_id.stdout }}/install-config" | ||
method: PATCH | ||
body: '"{\"networking\": {\"networkType\": \"{{ cluster_sdn | default("OVNKubernetes") }}\"}}"' | ||
body_format: json | ||
status_code: 201 | ||
|
||
- name: Copy the network file remotely if it exists | ||
copy: | ||
src: "{{ network_config_path }}" | ||
dest: "{{ temporary_path }}/network_config" | ||
when: network_config_path is defined and network_config_path|length>0 | ||
|
||
- name: Download the small ISO | ||
shell: "aicli create iso --minimal -P ssh_public_key='{{ ssh_public_key}}' {% if network_config_path is defined and network_config_path|length > 0 %}--paramfile {{ temporary_path }}/network_config{% endif %} {{ cluster_name }}" | ||
|
||
- name: And download it | ||
shell: "aicli download iso {{ cluster_name }} -p {{ final_iso_path }}" | ||
|
||
environment: | ||
AI_URL: "{{ ai_url }}" | ||
|
||
- name: create cluster | ||
include_role: | ||
name: "{{ playbook_dir }}/../common-roles/create-cluster" | ||
vars: | ||
extra_args: "-P high_availability_mode=None" | ||
cluster_name_var: "{{ cluster_name }}" | ||
|
||
- name: download ISO | ||
include_role: | ||
name: "{{ playbook_dir }}/../common-roles/download-iso" | ||
vars: | ||
cluster_name_var: "{{ cluster_name }}" | ||
final_iso_path_var: "{{ final_iso_path }}" | ||
minimal: True |
23 changes: 13 additions & 10 deletions
23
ai-deploy-cluster-singlenode/roles/deploy-cluster/tasks/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
- name: Install httpd package | ||
yum: | ||
name: | ||
- httpd | ||
state: present | ||
|
||
- name: make sure httpd landing page is disabled | ||
copy: | ||
content: "# Disabled" | ||
dest: /etc/httpd/conf.d/welcome.conf | ||
force: yes | ||
group: root | ||
owner: root | ||
mode: 0644 | ||
|
||
- name: Enable and (re)start httpd | ||
systemd: | ||
name: httpd | ||
enabled: yes | ||
masked: no | ||
state: restarted |