-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from stafwag/1-ensure-the-role-works-fine-with-…
…ansible-217x CleanUp
- Loading branch information
Showing
17 changed files
with
79 additions
and
41 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -15,6 +15,29 @@ An ansible role to update all packages (multiplatform) | |
* Suse | ||
* Kali GNU/Linux | ||
|
||
# Installation | ||
|
||
## Ansible galaxy | ||
|
||
The role is available on [Ansible Galaxy](https://galaxy.ansible.com/ui/standalone/roles/stafwag/package_update/). | ||
|
||
To install the role from Ansible Galaxy execute the command below. | ||
|
||
```bash | ||
ansible-galaxy install stafwag.package_update | ||
``` | ||
## Source Code | ||
|
||
If you want to use the source code directly. | ||
|
||
Clone the role source code. | ||
|
||
```bash | ||
$ git clone https://github.com/stafwag/ansible-role-package_update | ||
``` | ||
|
||
and put into the [role search path](https://docs.ansible.com/ansible/2.4/playbooks_reuse_roles.html#role-search-path) | ||
|
||
## Role Variables | ||
### OS related variables | ||
|
||
|
@@ -104,4 +127,4 @@ MIT/BSD | |
|
||
## Author Information | ||
|
||
Created by Staf Wagemakers, email: [email protected], website: http://www.wagemakers.be | ||
Created by Staf Wagemakers, email: [email protected], website: https://www.wagemakers.be, my company: https://mask27.dev |
This file contains 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,6 @@ | ||
--- | ||
- name: update packages | ||
hosts: localhost | ||
become: true | ||
roles: | ||
- stafwag.package_update |
This file contains 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 |
---|---|---|
@@ -1,45 +1,39 @@ | ||
--- | ||
galaxy_info: | ||
role_name: package_update | ||
namespace: stafwag | ||
author: staf wagemakers <[email protected]> | ||
description: Update all packages (multiplatform) | ||
license: license BSD, MIT) | ||
min_ansible_version: 2.4 | ||
platforms: | ||
- name: EL | ||
versions: | ||
- all | ||
- "all" | ||
- name: Fedora | ||
versions: | ||
- all | ||
- "all" | ||
- name: Debian | ||
versions: | ||
- all | ||
- "all" | ||
- name: Ubuntu | ||
versions: | ||
- all | ||
- "all" | ||
- name: opensuse | ||
versions: | ||
- all | ||
- "all" | ||
- name: SLES | ||
versions: | ||
- all | ||
- name: Archlinux | ||
- "all" | ||
- name: ArchLinux | ||
versions: | ||
- all | ||
- "all" | ||
- name: FreeBSD | ||
versions: | ||
- 10.0 | ||
- 10.1 | ||
- 10.2 | ||
- 10.3 | ||
- 10.4 | ||
- 11.0 | ||
- 11.1 | ||
- 11.2 | ||
- 12.0 | ||
- "all" | ||
- name: OpenBSD | ||
versions: | ||
- all | ||
- "all" | ||
galaxy_tags: | ||
- system | ||
- packaging | ||
|
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--- | ||
- name: pacman update | ||
pacman: | ||
update_cache: yes | ||
upgrade: yes | ||
community.general.pacman: | ||
update_cache: true | ||
upgrade: true |
This file contains 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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
--- | ||
- name: yum check-update | ||
command: yum check-update | ||
command: yum check-update # noqa command-instead-of-module | ||
register: yum_check_update | ||
changed_when: "yum_check_update.rc != 0" | ||
- name: run yum update -y | ||
command: yum update -y | ||
command: yum update -y # noqa command-instead-of-module | ||
when: "yum_check_update.rc != 0" |
This file contains 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 |
---|---|---|
@@ -1,11 +1,12 @@ | ||
--- | ||
- name: Update apt cache | ||
apt: | ||
update_cache: yes | ||
changed_when: False | ||
ansible.builtin.apt: | ||
update_cache: true | ||
changed_when: false | ||
- name: install aptitude | ||
apt: name=aptitude state=latest | ||
ansible.builtin.apt: name=aptitude state=present | ||
- name: Upgrade all | ||
apt: | ||
ansible.builtin.apt: | ||
upgrade: dist | ||
autoclean: yes | ||
autoremove: yes | ||
autoclean: true | ||
autoremove: true |
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,7 +1,13 @@ | ||
--- | ||
- name: execute jls | ||
shell: jls | sed 1d | awk '{ print $3 }' | ||
shell: | | ||
set -o errexit | ||
set -o pipefail | ||
set -o nounset | ||
jls | sed 1d | awk '{ print $3 }' | ||
register: cmd_jail_id_list | ||
changed_when: False | ||
changed_when: false | ||
- name: set freebsd_running_jails | ||
set_fact: | ||
freebsd_running_jails: '{{ cmd_jail_id_list.stdout_lines }}' |
This file contains 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
--- | ||
- name: set my_pkg_cmd var for host | ||
set_fact: | ||
my_pkg_cmd: pkg | ||
|
This file was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--- | ||
- name: pkgin update | ||
pkgin: | ||
full_upgrade: yes | ||
force: yes | ||
full_upgrade: true | ||
force: true |
This file contains 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--- | ||
- name: OpenBSD update | ||
openbsd_pkg: | ||
community.general.openbsd_pkg: | ||
name: '*' | ||
state: latest |
This file contains 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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
--- | ||
- name: yum update all | ||
yum: name=* state=latest | ||
ansible.builtin.yum: name=* state=latest # noqa package-latest |
This file contains 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
--- | ||
- name: update solaris | ||
debug: | ||
msg: Not implemented yet |
This file contains 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--- | ||
- name: SLES Update packages | ||
zypper: | ||
community.general.zypper: | ||
name: '*' | ||
state: latest |
This file contains 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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
--- | ||
- name: dnf update all | ||
dnf: name=* state=latest | ||
ansible.builtin.dnf: name=* state=latest # noqa package-latest |