Update packages on ubuntu and freebsd #1
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#1
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
I need an Ansible Playbook/workflow that is a very simple and easy one-liner for updating all my Ubuntu and FreeBSD servers.
I'm busy keeping up with a new job and I'm too mentally exhausted to figure out where to start with making some of these Ansible playbooks. I know there are a bunch of open-source resources like DebOps. I've made and modified some Ansible Roles and Playbooks before but I need help.
If you think I'm better off using some Workflow that combines DebOps and a FreeBSD Playbook, versus you re-inventing the wheel then I'll pay you for your time. I'll just need some idiot proof instructions.
Update packages on Ubuntu and FreeBSD.
freebsd
orubuntu
(ec2 tags)This Vagrantfile will make setting up the virtual environment easier. Upgraded to Ubuntu 18.04 on 2018-04-19
vagrant ssh ubuntu1
.Bonus (unnecessary):
Is it possible to have the Ansible Playbook/Workflow update Windows servers based on a
windows
tag in EC2? Sometimes there is no Windows server online.Misc:
Fork and submit a pull request when done.
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
I'm not eager to start looking at resources like debops, which is quite an extensive project, and can get quite far and complicated. Especially for this case, where what you need is quite simple, and short to be written.
This should be quite straightforward. A quick example of the logic (needs some tweaking of course, but taken from an existing example):
Of course, the target of those playbooks would match a group containing the machines with the right OS.
As for Windows updates, there are modules for that too: http://docs.ansible.com/ansible/latest/modules/win_updates_module.html
If no Windows machines are live, the playbook would be skipped, as no machines are targeted
As per your question aboutif one can can or how wise it is to update the OS non-interactively with FreeBSD's freebsd-update fetch && freebsd-update install, I can't really comment on that, my experience with FreeBSD is too limited for that. The same could apply to Ubuntu, but perhaps to a lesser extent.
Reviewing the list of updates, and checking if there are major updates to e.g. server processes that explifcitly run on it, is always a good idea. Running in test mode first can help here.
Let me know if this approach suits you, and I'll refine this into a couple of roles. (Expect +/- 2 hours of work.)
Small question: do you retrieve the server list with the aws/ec2 inventory script? Does this get you the right groups for Ubuntu and FreeBSD, or should those groups still be created based on a tag (supplied as parameter to the host?) Can you confirm me the right name of this group or tag?
For really small personal projects I would probably use a basic
hosts
file. But for any of my actual work I use aec2.py
dynamic inventory script. The playbook will look for tags like;Which in EC2 obviously look like; Eg.
OSType
ubuntu
Everything you said sounds good. I can't wait to build and learn with you.
Update 2018-04-19 15:01:38(PDT)
Regarding the FreeBSD
pkg
part. The commandpkg upgrade
technically runs update automatically before upgrading.pkg upgrade
may need some form of yes flag.It should be noted that Ubuntu 18.04 will be released on the 26th and removes
python2
from the base OS.So I updated this Vagrantfile. Upgraded to Ubuntu 18.04 on 2018-04-19
vagrant ssh ubuntu1
.If there are additional steps or methods needed for 18.04 please note that.
4PH41465DH4233330
About Python3 support, whilst docs don't mention it officially, I know Python3 is mostly supported, for the core application. On remote hosts, full support on modules might still be an issue, which could mean Python2 must be installed. Tests will show what is needed.
fyi https://twitter.com/svg/status/978648763488227328