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

host provision config tasks that follow initial connection setup #89

Merged
merged 7 commits into from
Nov 5, 2021

Conversation

jcnars
Copy link
Collaborator

@jcnars jcnars commented Sep 4, 2021

Post the user creation in the previous PR, extending the previously merged code with additional functionality in this PR.

Command called as:

~/DriveFS/My Drive/bmaas/host_provisioning/bms-toolkit [host-provision|…1] 
21:34 $ runlocalssh ./host-provision.sh --instance-ip-addr 172.16.30.1  --instance-ssh-user ansible9 --proxy-setup false --u01-lun /dev/mapper/3600a098038314344372b4f75392d3850 
Command used:
/usr/local/google/home/jcnarasimhan/DriveFS/My Drive/bmaas/host_provisioning/bms-toolkit/host-provision.sh --instance-ip-addr 172.16.30.1 --instance-ssh-user ansible9 --proxy-setup false --u01-lun /dev/mapper/3600a098038314344372b4f75392d3850

Running with parameters from command line or environment variables:

INSTANCE_SSH_USER=ansible9
INVENTORY_FILE=172.16.30.1,
ORA_CS_HOSTS=172.16.30.1
ORA_PROXY_SETUP=false
ORA_U01_LUN=/dev/mapper/3600a098038314344372b4f75392d3850

Found Ansible at /usr/bin/ansible-playbook

Running Ansible playbook: /usr/bin/ansible-playbook -i 172.16.30.1,   host-provision.yml

PLAY [Create private public key pair locally] **********************************************************************************************************************************

TASK [Gathering Facts] *********************************************************************************************************************************************************
ok: [localhost]

TASK [host-provision : Creates .ssh directory in control node if it does not exist] ********************************************************************************************
ok: [localhost]

Copy link
Member

@mfielding mfielding left a comment

Choose a reason for hiding this comment

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

Apologies for the delayed reply here.

host-provision.yml Outdated Show resolved Hide resolved
roles/host-provision/tasks/config-tasks.yml Outdated Show resolved Hide resolved
roles/host-provision/tasks/config-tasks.yml Outdated Show resolved Hide resolved
username: "{{ rhel_username }}"
password: "{{ rhel_password }}"
auto_attach: true
# we ignore when: "This system is already registered" is in the output
Copy link
Member

Choose a reason for hiding this comment

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

Can we please only ignore "This system is already registered" errors? I'd imagine that many other error cases would warrant issues.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Modifying the logic for this completely. The new logic (when I push my branch) will reside in: bms-toolkit/roles/host-provision/tasks/rhel-config-tasks.yml.

In essence the logic will:

  • Get current registration status of the host

  • If host is not 'Subscribed':
    * ask Redhat Support username/password on the cmd line
    * 
Register host in RHSM


With this, we don't have to ignore any errors.

roles/host-provision/tasks/proxy.yml Show resolved Hide resolved
roles/host-provision/tasks/proxy.yml Show resolved Hide resolved
roles/host-provision/tasks/proxy.yml Outdated Show resolved Hide resolved
roles/host-provision/tasks/proxy.yml Outdated Show resolved Hide resolved
roles/host-provision/tasks/proxy.yml Outdated Show resolved Hide resolved
group_vars/all.yml Show resolved Hide resolved
@jcnars
Copy link
Collaborator Author

jcnars commented Oct 13, 2021

https://paste.googleplex.com/6592815808118784 (internal) shows successful runs after code modification with different input options.

Here is the codeflow schematic for ref:
https://screenshot.googleplex.com/7uWan6c5N5Mrvyx (internal)

roles/host-provision/tasks/rhel-config-tasks.yml Outdated Show resolved Hide resolved
roles/host-provision/tasks/rhel-config-tasks.yml Outdated Show resolved Hide resolved
roles/host-provision/tasks/rhel-config-tasks.yml Outdated Show resolved Hide resolved
host-provision.sh Show resolved Hide resolved
@jcnars
Copy link
Collaborator Author

jcnars commented Oct 14, 2021

Incorporated changes.
After final shape/approval, will test in a reimaged host and take the gaps to do further changes in this same PR.

roles/host-provision/tasks/rhel-config-tasks.yml Outdated Show resolved Hide resolved
roles/host-provision/tasks/proxy.yml Show resolved Hide resolved
roles/host-provision/tasks/rhel-config-tasks.yml Outdated Show resolved Hide resolved
group_vars/all.yml Show resolved Hide resolved
@google-oss-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jcnars

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jcnars, mfielding

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jcnars jcnars merged commit fd47b25 into master Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants