-
Notifications
You must be signed in to change notification settings - Fork 3
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
ENH: prod scripts #12
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good, we chatted about the future plans and I'm pretty excited for what this can unlock. I think it's good to get this in and keep iterating on it
tc_install_pip_packages: | ||
# - pytmc | ||
# Uninstall pip after using it? | ||
tc_uninstall_pip: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we uninstall this? For security reasons? I'd expect future updates / playbooks to need pip, naively
Edit: Nominally for security reasons, though this is vestigial and we can loop back to it later
|
||
# Alternatively, only add missing routes from the list: | ||
tc_add_missing_static_routes: | ||
- name: PC98125 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which PC Is this? Is this the PC that will be performing future updates? (the "control node"?)
Edit: This is Ken's PC. This bit is vestigial, and we can loop back to it later
### Quick start: set up a new plc in prod | ||
1. clone the repo | ||
2. run ``./scripts/first_time_setup.sh your-plc-name`` | ||
3. Edit ``./inventory/plcs.yaml`` to add your plc (and possibly an appropriate group) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note from a conversation with Zach, steps 2 and 3 need to be swapped
|
||
run-provision: run-bootstrap tcbsd-provision-playbook.yaml | ||
ansible-playbook tcbsd-provision-playbook.yaml | ||
ansible-playbook tcbsd-provision-playbook.yaml --extra-vars "target=vms_all ansible_ssh_private_key_file=${SSH_KEY_FILENAME}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arbitrarily noting this here: It might be worth considering ansible-vault to manage secrets. But that's just an association I made, I'm not convinced yet that it's the right solution
I've rearranged things a bit in advance of using this on production PLCs. In github diff order:
Makefile
is relegated to the VM workflows and hopefully works as it did before. This was kind of strange for use on prod PLCs for various reasons, e.g. the single hard-coded IP in a system that can nominally apply itself to many PLC hosts at once. A few edits were made here to match the rest of the changes, but I am not going to go back to testing on VMs for the moment.plc-tst-bsd
has been added to the inventory, in thetst_all
group.scripts/first_time_setup.sh
has been added, which is intended to be used to do the one-time pre-setup for a new PLC. This is intended to be run on exactly one PLC at a time.scripts/provision_plcs.sh
has been added, which is intended to do the main part of the setup (and also, to re-do the main part of the setup if needed, e.g. in the case of changed settings). This can be run on any single PLC in the inventory or on any defined group all at once, e.g. you could update RIX all at once if you wanted to.Unsolved mysteries:
twincat-bsd-ansible/ansible.cfg
Lines 6 to 7 in 9f9259f
Hopefully these seem sensible... at this point, I can reasonably hand this off to someone else to try, though a few of the steps are still manual (current struggle documented at https://confluence.slac.stanford.edu/display/~zlentz/TcBSD+Notes). I have a list of specific steps to add to the ansible playbook in future PRs.