Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCTOPUS-625:Moved Ignition and templates files to virtual machine folder #20

Merged
merged 1 commit into from
Apr 16, 2024

Conversation

pkenchap
Copy link
Collaborator

Removed the ignition roles and added as part of virtual machine task .
Modified the templates for virtual machine .

@pkenchap pkenchap self-assigned this Apr 15, 2024
@pkenchap pkenchap requested a review from prb112 April 15, 2024 08:22
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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# virtual_machine_create_userdata: "#!/bin/sh\nyum -y install python3"

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 }}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# virtual_machine_create_userdata: "{{ lookup('file', '/var/www/html/ignition/worker-amd64.ign') | string }}"

@@ -21,3 +23,18 @@ virtual_machine_create_userdata: "#!/bin/sh\nyum -y install python3"
# - ansible
# package_upgrade: true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# package_upgrade: true

@@ -21,3 +23,18 @@ virtual_machine_create_userdata: "#!/bin/sh\nyum -y install python3"
# - ansible
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# - ansible

@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
url: https://{{ virtual_machine_create_bastion_ip }}:22623/config/worker
url: https://{{ bastion_ip }}:22623/config/worker

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's just call it bastion_ip

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ansible lint expects to have a role name as a prefix for the variable names . if we just keep bastion_ip it was giving error .

@@ -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 }}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
worker_hostname_encoded: "{{ virtual_machine_create_worker_hostname | b64encode }}"
worker_hostname_encoded: "{{ worker_hostname | b64encode }}"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use worker_hostname. it's more readable

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ansible lint expects to have a role name as a prefix for the variable names .

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 }}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use dns_none_conf

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above .

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 }}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
dns_none_encoded: "{{ virtual_machine_create_dns_none_conf | b64encode }}"
dns_none_encoded: "{{ dns_none_conf | b64encode }}"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ansible lint expects to have a role name as a prefix for the variable names .

@@ -1,5 +1,8 @@
---
# file: intel-worker-playbook.yml
- name: Add identity resources
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: Add identity resources
- name: Add ignition resources

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure , I will make these changes.

Comment on lines +1 to +2
search {{ virtual_machine_create_domain_name }}
nameserver {{ virtual_machine_create_bastion_ip }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
search {{ virtual_machine_create_domain_name }}
nameserver {{ virtual_machine_create_bastion_ip }}
search {{ domain_name }}
nameserver {{ bastion_ip }}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ansible lint expects to have a role name as a prefix for the variable names .

"path": "/etc/NetworkManager/conf.d/90-dns-none.conf",
"user": {},
"contents": {
"source": "data:text/plain;base64,{{ virtual_machine_create_dns_none_encoded }}",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"source": "data:text/plain;base64,{{ virtual_machine_create_dns_none_encoded }}",
"source": "data:text/plain;base64,{{ dns_none_encoded }}",

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ansible lint expects to have a role name as a prefix for the variable names .

"path": "/etc/resolv.conf",
"user": {},
"contents": {
"source": "data:text/plain;base64,{{ virtual_machine_create_etc_resolve_encoded }}",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"source": "data:text/plain;base64,{{ virtual_machine_create_etc_resolve_encoded }}",
"source": "data:text/plain;base64,{{ etc_resolve_encoded }}",

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ansible lint expects to have a role name as a prefix for the variable names .

"path": "/etc/hostname",
"user": {},
"contents": {
"source": "data:text/plain;base64,{{ virtual_machine_create_worker_hostname_encoded }}",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"source": "data:text/plain;base64,{{ virtual_machine_create_worker_hostname_encoded }}",
"source": "data:text/plain;base64,{{ hostname_encoded }}",

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ansible lint expects to have a role name as a prefix for the variable names .

"config": {
"merge": [
{
"source": "http://{{ virtual_machine_create_bastion_ip }}:{{ virtual_machine_create_http_port }}/ignition/worker-amd64.ign"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"source": "http://{{ virtual_machine_create_bastion_ip }}:{{ virtual_machine_create_http_port }}/ignition/worker-amd64.ign"
"source": "http://{{ bastion_ip }}:{{ http_port }}/ignition/worker-amd64.ign"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ansible lint expects to have a role name as a prefix for the variable names .

@prb112
Copy link
Collaborator

prb112 commented Apr 15, 2024

Hey Punith,

Made some comments based on readability.
Please address when you can.

@prb112
Copy link
Collaborator

prb112 commented Apr 16, 2024

Discussed with Punith the restrictions on variable names
/LGTM

@prb112 prb112 merged commit 75f22c8 into ocp-power-automation:main Apr 16, 2024
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants