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 - bootstrapping actions done as customeradmin #88

Merged
merged 10 commits into from
Sep 3, 2021

Conversation

jcnars
Copy link
Collaborator

@jcnars jcnars commented Aug 31, 2021

Ansible user creation and configuring ssh equivalence for the created user between the control node and DB hosts.

Successful validation: https://gist.github.com/jcnars/ff9d76574c9db4028a683faf0db6f8b1

Once this PR is reviewed and merged, will be using the same branch to submit other host provisioning actions
(typically, those may no longer need the customeradmin)

@jcnars jcnars requested a review from mfielding August 31, 2021 22:29
group_vars/all.yml Outdated Show resolved Hide resolved
host-provision.yml Show resolved Hide resolved
host-provision.yml Outdated Show resolved Hide resolved
roles/host-provision/tasks/ssh-keygen.yml Outdated Show resolved Hide resolved
roles/host-provision/tasks/ssh-keygen.yml Outdated Show resolved Hide resolved
host-provision.sh Outdated Show resolved Hide resolved
host-provision.yml Outdated Show resolved Hide resolved
roles/host-provision/tasks/ssh-keygen.yml Show resolved Hide resolved
roles/host-provision/tasks/ssh-keygen.yml Outdated Show resolved Hide resolved
host-provision.sh Outdated Show resolved Hide resolved
@jcnars
Copy link
Collaborator Author

jcnars commented Sep 2, 2021

The inventory file creation has been avoided.

More structure introduced that will lend well into the next stage of introducing the core logic of host provisioning, like LVM, RHEL subscription, etc.

https://gist.github.com/jcnars/6858344c22cef0d94b851a17de68f1c8 contains the successful run of the following:

~/050521-mntrl-instlln/bms-toolkit [host-provision L|✚ 2…19] 
21:47 $ ./host-provision.sh --comma-separated-dbhosts 172.16.30.1  --instance-ssh-user ansible10
Command used:
./host-provision.sh --comma-separated-dbhosts 172.16.30.1 --instance-ssh-user ansible10

Running with parameters from command line or environment variables:

INSTANCE_SSH_USER=ansible10
INVENTORY_FILE=172.16.30.1,
ORA_CS_HOSTS=172.16.30.1

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] ************

roles/host-provision/tasks/ssh-keygen.yml Outdated Show resolved Hide resolved
roles/host-provision/tasks/ssh-keygen.yml Outdated Show resolved Hide resolved
host-provision.sh Outdated Show resolved Hide resolved
@@ -131,3 +131,8 @@ install_rdbms: true
disable_firewall: false

## End of non-modifiable variables section

## host provision variables
Copy link
Member

Choose a reason for hiding this comment

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

I thought I put in a coment about this, but now can't find it. Apologies if it's duplicated.

In terms of group vars, I'd prefer if we don't have hostprovision in the name, and instead have the ability to reuse them across multiple parts of the code, now or in the future.

A suggestion for naming:
instance_ssh_user
firsttime_connect_user
control_node_key_file

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Got it, will do

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

All of the suggestions here have been incorporated and tested successfully.
https://gist.github.com/jcnars/d0e4887c736ddbd3dcc5c9a26d4d24db

Pls check if it looks good.

Thanks

host-provision.sh Outdated Show resolved Hide resolved
host-provision.yml Outdated Show resolved Hide resolved
host-provision.yml Outdated Show resolved Hide resolved
host-provision.yml Show resolved Hide resolved
@@ -38,10 +38,10 @@
hosts: all
vars_prompt:
- name: ansible_password
prompt: Enter customeradmin password
prompt: Enter firsttime_connect_user password
Copy link
Member

Choose a reason for hiding this comment

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

Is there a way to dereference the variable so that a user will see "Enter customeradmin password"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There may be, but first glance, extrapolating this variable is introducing complexity that we can do away.

host-provision.yml Outdated Show resolved Hide resolved
host-provision.yml Outdated Show resolved Hide resolved
@jcnars jcnars merged commit 631aa29 into master Sep 3, 2021
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.

None yet

2 participants