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

TOPS-102: Ansible Integration #66

Merged
merged 45 commits into from
Sep 29, 2021
Merged

Conversation

yesrod
Copy link
Collaborator

@yesrod yesrod commented Sep 27, 2021

Ansible status update:

  • Root playbook created. Had to copy the playbooks that Cody already created into one file; using include_playbook changes the scope to the included playbook's directory which broke things.
  • Ansible Vault password file is copied from ~gitlab-runner to the Ansible directory during the appropriate pipeline stage. We probably need a better method for this. It's now sourced from a masked variable from GitLab.
  • Added IP aliases to the pfSense SERVERS interface (10.101.22.0/24) for dev, main, aaron-dev branch subnets. We can now get to hosts in those subnets from other hosts.
  • Added gateway configuration to Terraform-created guests for the above
  • Cody copied in the existing mag_ansible_id_ed25519 SSH key to the GitLab runner. Need to figure out how to distribute that during runner setup. (Probably a bootstrap Ansible playbook for GitLab, the runner, Proxmox, etc.)
  • Figured out that the container user is root not ubuntu . Set remote_user accordingly in Ansible.
  • Lots of DNS rework: reformatting the list of hosts, fixing config file locations and directory ownership for Ubuntu, etc.
  • Fixed a bunch of Ansible stuff, including a few typos.
  • Added permissions to the host enrollment role in FreeIPA to allow the binduser to enroll hosts as intended.
  • Reworked the hosts file format to have correct host names, so Ansible has the correct data to set host names.
  • Whole bunch of linter fixes.

Known issues:

  • After guest creation, some containers aren't on the network/pingable, meaning the Ansible step fails because the runner can't get to the containers. Repeated container reboots seem to eventually fix the issue.

Run pipelines on all branches that have a subnet defined.
Destroy stage will not run on "prod" to prevent accidents.
Role is designed to set up DNS server on appropriate guests, and
populate /etc/hosts for all guests.
Currently handles basic configuration of all Ubuntu guests, as well as
DNS server/client setup, CUPS server, and rsyslog server.
I suspect this might be why the early stages aren't working with
the dev branch
Collections are supposed to install during the general install command,
but that's not working for some reason.
If you use include_playbook, it changes the scope to that playbook's
directory, so it can't find any of the roles and stuff.
The Ubuntu runner needs a way to SSH to the created guests for Ansible.
The containers don't have an ubuntu user; root only.
The inventory directory has vault stuff and group vars, but Terraform
creates a hosts file for us in a different directory.  This should use
both.
For some reason, doing the host entries like I was doing before wouldn't
allow anything to pick up the third variable in the dict.  I fixed this
by specifically formatting each host entry as a dict.
Also add the rsyslog Terraform module.
The Terraform-created hosts file uses IPs, not hostnames, so the DNS
servers weren't getting set up.
Regex wasn't working, but apparently I can use group_names to determine
if the current host is in the dns group.
Copy link
Collaborator

@claughinghouse claughinghouse left a comment

Choose a reason for hiding this comment

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

Changes look good but I would like to have @aaronsaderholm take a pass at all the terraform files.

ansible/playbook.yaml Outdated Show resolved Hide resolved
@claughinghouse claughinghouse linked an issue Sep 27, 2021 that may be closed by this pull request
Closed
1 task
@claughinghouse claughinghouse merged commit db42f73 into main Sep 29, 2021
@claughinghouse claughinghouse deleted the TOPS-102_ansible_integration branch September 29, 2021 16:43
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.

DNS
2 participants