Update packages on ubuntu and freebsd #3
			No reviewers
			
		
		
		
	
	
	
		Labels
		
	
	
	
	No labels
	
		
			
	
	bug
		
			duplicate
		
			enhancement
		
			good first issue
		
			help wanted
		
			invalid
		
			question
		
			todo
		
			todo 🗒️
		
			wontfix
		
		
	
		No milestone
		
			
		
	No project
	
		
	
	
	
	
		No assignees
		
	
	
		
			
		
	
	
	
		1 participant
	
	
		
		
	Notifications
	
		
	
	
	
		
	
	
	Due date
No due date set.
	
		Dependencies
		
		
	
	
	No dependencies set.
	
	
		
	
	
		
			Reference
		
	
	
		
	
	
			stationgroup/ansible-experiments!3
			
		
	
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	
	No description provided.
		
		Delete branch "feature-package-updates-#1"
	
	Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #1
The Vagrant file being used is a copy from
https://github.com/stationgroup/vagrant-labs/tree/master/imperialspeculate.Two roles are being used: debian-upgrade (an upstream Galaxy role) and
freebsd-upgrade (a small role based on what was proposed in the comments of #1
and extended with proper support for check mode.)
The upgrade process is contained in the playbook os_upgrade.yml, which will
automatically create proper groups for Ubuntu and FreeBSD hosts. If unneeded,
this first play can be left out, and the target hosts: in the second play can be
replaced by the relevant groups you have in the inventory (e.g. ec2 tags.)
A local ansible.cfg is defined, and needed for these scripts to run out of the
box. This implies that all ansible commands must be run from the
ansible-experiments/package_updatesfolder.A small script
setup-requirementsis provided, that initializes everything,to be executed after the vagrant boxes came online. It will generate an
ssh-config for said vagrant boxes, download roles from galaxy, and make a
base-install for the hosts (installing python dependencies, ansible itself
on ubuntu1, a deploying an ssh key to all nodes to be used from the vagrant box
ubuntu1, as ansible controller machine.)When deploying and setting up from the machine where vagrant runs, you need to
add some extra arguments:
--ssh-extra-args "-F ./vagrant-ssh-config" --inventory hosts-vagrantto ansible execution. These are not necessary once running ansible from
ubuntu1.The vagrant setup seems to have a provisioning bug, that kicks in with the
latest 18.04 Ubuntu. The FreeBSD boxes also experience a provisioning problem,
with the same result: the second, private network interface does not get
configured. As these interfaces are used to run ansible from
ubuntu1, I couldnot fully test the scripts from there.
Log of what I ran and where I hit issues
After I clone the branch in your ginsys fork for testing I ran started up all the VMs with
vagrant up.I start to initialize them with:
./setup-requirementsI saw that error and thought maybe I have to
vagrant ssh ubuntu1and runsudo apt update, because the repos were out of date.Now I get this error with I re-run
./setup-requirements:⬆️ Keep in mind the error above doesn't wrap, and scrolls off screen to the right.
After running it a 3rd time the pip process completes on ubuntu1 without issue.
I'm guessing the error below is what you were referring to.
[freebsd-update] step fails with the following error:
Ansible from
ubuntu1ansible controller VMFirst I did a git clone of the ginsys repo for testing again, and
cdinto the correct directory.ansible-playbook os_upgrade.ymlfailed because of a typo that I corrected here:ginsys/ansible-experiments@e6cd6bc239.I ran
ansible-playbook os_upgrade.ymlagain from ubuntu1:Continuing the
freebsd6error mysteryI exited ubuntu1 and
vagrant ssh freebsd6to investigate why it always failed.I thought maybe if I manually did a
sudo pkg upgradeI would see an error or some clue.Maybe freebsd6 is failing because it can't handle this ABI changing REINSTALL?:
After a manual
sudo pkg upgradeI exited freebsd6 andvagrant ssh ubuntu1.From ubuntu1 I
cdto the correct directory and ranansible-playbook os_upgrade.ymlagain to see if it gets further.The upgrade seemed to get further, I'm not sure why. But it still reports a failure.
I ran
ansible-playbook os_upgrade.ymlagain after the failure above and it seems to success.Finally finished without error.
x-post: https://github.com/stationgroup/ansible-experiments/pull/3
https://github.com/stationgroup/ansible-experiments/issues/4
https://github.com/stationgroup/ansible-experiments/issues/1
⚠️ MOVED TO #4
The provisioning problem I mentioned: A clean
Vagrant upends at theubuntu3node:Given you don't seem to encounter this, I checked and installed the latest upstream versions of virtualbox and vagrant, and those seem to solve this.
As for the freebsd boxes, I still have got an issue that they took more time to come up, provisioning erroring on a timeout. Solved by adding
freebsd5.vm.boot_timeout = 600to the Vagrantfile.The long first boot on the FreeBSD VMs is from the
freebsd-update installand reboot they perform after first provisioning.