This repository was archived by the owner on Jun 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
ansible: Add system update playbook #258
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| System base update | ||
| ================== | ||
|
|
||
| Update the base operating system components. Supports the native | ||
| update mechanisms for: | ||
|
|
||
| - FreeBSD (freebsd-update) | ||
| - Linux/RedHat (yum) | ||
| - Linux/Debian (apt) | ||
| - MacOS X (softwareupdate) | ||
| - Windows | ||
|
|
||
| Note that on systems with a package manager, this may update packages | ||
| in addition to the base system. | ||
|
|
||
| Requirements | ||
| ------------ | ||
|
|
||
| None. | ||
|
|
||
| Author Information | ||
| ------------------ | ||
|
|
||
| ome-devel@lists.openmicroscopy.org.uk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| --- | ||
| # Defaults |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| --- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| --- | ||
| - name: Update MacOS X base system | ||
| raw: softwareupdate -i -a | ||
| become: yes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| - name: Update Debian APT repositories | ||
| apt: | ||
| update_cache: yes | ||
|
|
||
| - name: Upgrade Debian packages | ||
| apt: | ||
| upgrade: dist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| - name: Fetch new FreeBSD updates | ||
| command: freebsd-update fetch --not-running-from-cron | ||
| register: result_update | ||
| changed_when: "'No updates needed' not in result_update.stdout" | ||
| become: yes | ||
|
|
||
| - name: Install FreeBSD updates | ||
| command: freebsd-update install | ||
| when: ansible_distribution == 'FreeBSD' and result_update.changed | ||
| register: result_update_install | ||
| become: yes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| --- | ||
| - include: darwin.yml | ||
| when: ansible_os_family == 'Darwin' | ||
| tags: package | ||
|
|
||
| - include: debian.yml | ||
| when: ansible_os_family == 'Debian' | ||
| tags: package | ||
|
|
||
| - include: freebsd.yml | ||
| when: ansible_os_family == 'FreeBSD' | ||
| tags: package | ||
|
|
||
| - include: redhat.yml | ||
| when: ansible_os_family == 'RedHat' | ||
| tags: package | ||
|
|
||
| - include: windows.yml | ||
| when: ansible_os_family == 'Windows' | ||
| tags: package |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| - name: Upgrade all RPM packages | ||
| yum: | ||
| name: '*' | ||
| state: latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| # Install all security, critical, and rollup updates | ||
| - name: Install Windows updates | ||
| win_updates: | ||
| category_names: | ||
| - SecurityUpdates | ||
| - CriticalUpdates | ||
| - UpdateRollups |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| System package update | ||
| ===================== | ||
|
|
||
| Update packages with the system package manager. Supports the | ||
| following systems: | ||
|
|
||
| - FreeBSD (pkgng) | ||
| - Linux/RedHat (yum) | ||
| - Linux/Debian (apt) | ||
| - MacOS X (homebrew) | ||
|
|
||
| Requirements | ||
| ------------ | ||
|
|
||
| None. | ||
|
|
||
| Author Information | ||
| ------------------ | ||
|
|
||
| ome-devel@lists.openmicroscopy.org.uk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| --- | ||
| # Defaults | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| --- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| - name: Update Debian APT repositories | ||
| apt: | ||
| update_cache: yes | ||
|
|
||
| - name: Upgrade Debian packages | ||
| apt: | ||
| upgrade: safe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| --- | ||
| - name: Update and upgrade homebrew packages | ||
| homebrew: | ||
| update_homebrew: yes | ||
| upgrade_all: yes | ||
|
|
||
| - name: Clean up homebrew | ||
| command: brew cleanup | ||
|
|
||
| - name: Prune stale homebrew links | ||
| command: brew prune | ||
|
|
||
| - name: Check homebrew for problems | ||
| command: brew doctor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| --- | ||
| - include: homebrew.yml | ||
| when: ansible_pkg_mgr == 'homebrew' | ||
| tags: package | ||
| become: true | ||
| become_user: "{{homebrew_user}}" | ||
| environment: | ||
| PATH: "/usr/local/bin:/usr/local/sbin:{{ ansible_env.PATH }}" | ||
|
|
||
| - include: apt.yml | ||
| when: ansible_pkg_mgr == 'apt' | ||
| tags: package | ||
|
|
||
| - include: pkgng.yml | ||
| when: ansible_pkg_mgr == 'pkgng' | ||
| tags: package | ||
|
|
||
| - include: yum.yml | ||
| when: ansible_pkg_mgr == 'yum' | ||
| tags: package |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| - name: Update FreeBSD package list | ||
| command: pkg update -q | ||
| become: yes | ||
|
|
||
| - name: Upgrade FreeBSD packages | ||
| command: pkg upgrade -y | ||
| become: yes | ||
|
|
||
| - name: Clean FreeBSD package cache | ||
| command: pkg clean -qy | ||
| become: yes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| - name: Upgrade all RPM packages | ||
| yum: | ||
| name: '*' | ||
| state: latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| # Apply operating system and package updates | ||
|
|
||
| - hosts: all | ||
| roles: | ||
| - role: system-base-update | ||
| - role: system-package-update | ||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
There's no need to commit empty files