Skip to content

Commit

Permalink
OCTOPUS-625:Moved Ignition and templates files to virtual machine folder
Browse files Browse the repository at this point in the history
Signed-off-by: Punith Kenchappa <[email protected]>
  • Loading branch information
pkenchap committed Apr 15, 2024
1 parent 37e0f0e commit f8f8359
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
virtual_machine_create_name: rdr-mac-worker
virtual_machine_create_region_name: RegionOne
virtual_machine_create_availability_zone: Test
virtual_machine_create_image_name: 0c4d9ba3-ed14-403a-a35d-8b4c9f720f1f
virtual_machine_create_flavor: "PUN_custom_flavor"
virtual_machine_create_image_name: 4df699b6-6877-4b77-9ddb-0d6dc9cefb68
virtual_machine_create_flavor: "m1.medium"
virtual_machine_create_volume_size: 80
virtual_machine_create_keypair_name: pun_keypair
virtual_machine_create_network_name: provider
virtual_machine_create_userdata: "#!/bin/sh\nyum -y install python3"
virtual_machine_create_userdata: "{{ lookup('template', 'worker-amd64.ign.j2') }}"
# virtual_machine_create_userdata: "{{ lookup('file', '/var/www/html/ignition/worker-amd64.ign') | string }}"
# virtual_machine_create_userdata: "#!/bin/sh\nyum -y install python3"
# virtual_machine_userdata: "|\n#cloud-config\nchpasswd:\nlist: |\nubuntu:passw0rd\nexpire: False\npackages:\n- ansible\npackage_upgrade: true"
# Examples:
# userdata: |
Expand All @@ -21,3 +23,18 @@ virtual_machine_create_userdata: "#!/bin/sh\nyum -y install python3"
# - ansible
# package_upgrade: true
virtual_machine_create_timeout: 300

# Used in ignition task
virtual_machine_create_worker_hostname: "rdr-mac"
virtual_machine_create_worker_hostname_encoded: ""
virtual_machine_create_etc_resolve_encoded: ""
virtual_machine_create_dns_none_encoded: ""
virtual_machine_create_bastion_ip: "10.20.181.69"
virtual_machine_create_domain_name: "rdr-mac"
virtual_machine_create_http_port: "8080"
virtual_machine_create_https_port: "443"

# Ignition Files
virtual_machine_create_dns_none_conf: |-
[main]
dns=none
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Create worker.ign and store it to /var/www/html/ignition/
ansible.builtin.get_url:
url: https://{{ bastion_ip }}:22623/config/worker
url: https://{{ virtual_machine_create_bastion_ip }}:22623/config/worker
validate_certs: false
dest: /var/www/html/ignition/worker-amd64.ign
mode: "0644"
Expand All @@ -14,8 +14,8 @@

- name: Set the variables (To be used in Customization Script)
ansible.builtin.set_fact:
worker_hostname_encoded: "{{ worker_hostname | b64encode }}"
dns_none_encoded: "{{ dns_none_conf | b64encode }}"
worker_hostname_encoded: "{{ virtual_machine_create_worker_hostname | b64encode }}"
dns_none_encoded: "{{ virtual_machine_create_dns_none_conf | b64encode }}"
etc_resolve_encoded: "{{ lookup('template', 'resolv.conf.j2') | b64encode }}"

- name: Create the Intel ignition file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
# file: intel-worker-playbook.yml
- name: Add identity resources
ansible.builtin.include_tasks:
file: ignition.yml

- name: Create server in the Multi-Arch Compute OpenStack Instance

Check failure on line 7 in openstack/intel-worker/playbooks/roles/virtual_machine_create/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

syntax-check[unknown-module]

couldn't resolve module/action 'openstack.cloud.server'. This often indicates a misspelling, missing collection, or incorrect module path.
openstack.cloud.server:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
search {{ virtual_machine_create_domain_name }}
nameserver {{ virtual_machine_create_bastion_ip }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"ignition": {
"version": "3.4.0",
"config": {
"merge": [
{
"source": "http://{{ virtual_machine_create_bastion_ip }}:{{ virtual_machine_create_http_port }}/ignition/worker-amd64.ign"
}
]
}
},
"timeouts": {
"httpTotal": 15
},
"storage": {
"files": [
{
"group": {},
"path": "/etc/hostname",
"user": {},
"contents": {
"source": "data:text/plain;base64,{{ virtual_machine_create_worker_hostname_encoded }}",
"verification": {}
},
"mode": 420
},
{
"group": {},
"path": "/etc/resolv.conf",
"user": {},
"contents": {
"source": "data:text/plain;base64,{{ virtual_machine_create_etc_resolve_encoded }}",
"verification": {}
},
"mode": 420
},
{
"group": {},
"path": "/etc/NetworkManager/conf.d/90-dns-none.conf",
"user": {},
"contents": {
"source": "data:text/plain;base64,{{ virtual_machine_create_dns_none_encoded }}",
"verification": {}
},
"mode": 420
}
]
}
}

0 comments on commit f8f8359

Please sign in to comment.