Compare commits
No commits in common. "66078bf3ad8c999b86b250b7362dacce95417e29" and "4d14d4d49f8d475a3eec564f471b04da1c84a9b5" have entirely different histories.
66078bf3ad
...
4d14d4d49f
7
.gitignore
vendored
Normal file
7
.gitignore
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
roles/*
|
||||||
|
!roles/.keep
|
||||||
|
!roles/etc_hosts
|
||||||
|
!roles/base_packages
|
||||||
|
!roles/resolv_conf
|
||||||
|
!roles/update_all_packages
|
||||||
|
!roles/motd
|
34
ansible.cfg
Normal file
34
ansible.cfg
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
[defaults]
|
||||||
|
inventory = /etc/ansible/zen_inventory.yml
|
||||||
|
roles_path = /etc/ansible/roles
|
||||||
|
collections_path = /etc/ansible/collections
|
||||||
|
remote_tmp = /tmp/.ansible-${USER}/tmp
|
||||||
|
gathering = smart
|
||||||
|
gather_timeout = 30
|
||||||
|
fact_path = /etc/ansible/facts
|
||||||
|
fact_caching = jsonfile
|
||||||
|
fact_caching_connection = facts.d
|
||||||
|
fact_caching_timeout = 300
|
||||||
|
retry_files_enabled = False
|
||||||
|
forks = 40
|
||||||
|
timeout = 30
|
||||||
|
host_key_checking = False
|
||||||
|
display_skipped_hosts = False
|
||||||
|
bin_ansible_callbacks = True
|
||||||
|
callback_whitelist = ansible.posix.profile_tasks, ansible.posix.timer
|
||||||
|
deprecation_warnings = False
|
||||||
|
command_warnings = False
|
||||||
|
|
||||||
|
|
||||||
|
[ssh_connection]
|
||||||
|
pipelining = True
|
||||||
|
ssh_args = -o ControlMaster=auto -o ControlPersist=60s -o PreferredAuthentications=publickey
|
||||||
|
|
||||||
|
|
||||||
|
[galaxy]
|
||||||
|
server_list = pah
|
||||||
|
|
||||||
|
|
||||||
|
[galaxy_server.pah]
|
||||||
|
url=https://hub.thezengarden.net/api/galaxy/content/inbound-jchristianh/
|
||||||
|
token=1a9e01d61c2528a3661f1a6ceea07dafeca63198
|
10
galaxy.yml
10
galaxy.yml
@ -8,7 +8,7 @@ namespace: jchristianh
|
|||||||
name: baseos
|
name: baseos
|
||||||
|
|
||||||
# The version of the collection. Must be compatible with semantic versioning
|
# The version of the collection. Must be compatible with semantic versioning
|
||||||
version: 1.0.9
|
version: 1.0.4
|
||||||
|
|
||||||
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
|
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
|
||||||
readme: README.md
|
readme: README.md
|
||||||
@ -43,16 +43,16 @@ tags: []
|
|||||||
dependencies: {}
|
dependencies: {}
|
||||||
|
|
||||||
# The URL of the originating SCM repository
|
# The URL of the originating SCM repository
|
||||||
repository: https://gitea.thezengarden.net/ansible_collections/ansible-collection-baseos
|
repository: https://github.com/jchristianh-ansible-collections/baseos
|
||||||
|
|
||||||
# The URL to any online docs
|
# The URL to any online docs
|
||||||
documentation: https://gitea.thezengarden.net/ansible_collections/ansible-collection-baseos
|
documentation: https://github.com/jchristianh-ansible-collections/baseos
|
||||||
|
|
||||||
# The URL to the homepage of the collection/project
|
# The URL to the homepage of the collection/project
|
||||||
homepage: https://gitea.thezengarden.net/ansible_collections/ansible-collection-baseos
|
homepage: https://github.com/jchristianh-ansible-collections/baseos
|
||||||
|
|
||||||
# The URL to the collection issue tracker
|
# The URL to the collection issue tracker
|
||||||
issues: https://gitea.thezengarden.net/ansible_collections/ansible-collection-baseos
|
issues: https://github.com/jchristianh-ansible-collections/baseosissues
|
||||||
|
|
||||||
# A list of file glob-like patterns used to filter any files or directories that should not be included in the build
|
# A list of file glob-like patterns used to filter any files or directories that should not be included in the build
|
||||||
# artifact. A pattern is matched from the relative path of the file or directory of the collection directory. This
|
# artifact. A pattern is matched from the relative path of the file or directory of the collection directory. This
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
---
|
---
|
||||||
requires_ansible: ">=2.14"
|
requires_ansible: ">=2.10"
|
||||||
|
31
plugins/README.md
Normal file
31
plugins/README.md
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
# Collections Plugins Directory
|
||||||
|
|
||||||
|
This directory can be used to ship various plugins inside an Ansible collection. Each plugin is placed in a folder that
|
||||||
|
is named after the type of plugin it is in. It can also include the `module_utils` and `modules` directory that
|
||||||
|
would contain module utils and modules respectively.
|
||||||
|
|
||||||
|
Here is an example directory of the majority of plugins currently supported by Ansible:
|
||||||
|
|
||||||
|
```
|
||||||
|
└── plugins
|
||||||
|
├── action
|
||||||
|
├── become
|
||||||
|
├── cache
|
||||||
|
├── callback
|
||||||
|
├── cliconf
|
||||||
|
├── connection
|
||||||
|
├── filter
|
||||||
|
├── httpapi
|
||||||
|
├── inventory
|
||||||
|
├── lookup
|
||||||
|
├── module_utils
|
||||||
|
├── modules
|
||||||
|
├── netconf
|
||||||
|
├── shell
|
||||||
|
├── strategy
|
||||||
|
├── terminal
|
||||||
|
├── test
|
||||||
|
└── vars
|
||||||
|
```
|
||||||
|
|
||||||
|
A full list of plugin types can be found at [Working With Plugins](https://docs.ansible.com/ansible-core/2.12/plugins/plugins.html).
|
2
roles/base_packages/handlers/main.yml
Normal file
2
roles/base_packages/handlers/main.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
# handlers file for base_packages
|
@ -1,20 +1,43 @@
|
|||||||
galaxy_info:
|
galaxy_info:
|
||||||
author: Chris Hammer
|
author: your name
|
||||||
description: Installs a defined set of packages on each inventory host.
|
description: your role description
|
||||||
|
company: your company (optional)
|
||||||
|
|
||||||
license: GPL-2.0-or-later
|
# If the issue tracker for your role is not on github, uncomment the
|
||||||
|
# next line and provide a value
|
||||||
|
# issue_tracker_url: http://example.com/issue/tracker
|
||||||
|
|
||||||
min_ansible_version: "2.14"
|
# Choose a valid license ID from https://spdx.org - some suggested licenses:
|
||||||
|
# - BSD-3-Clause (default)
|
||||||
|
# - MIT
|
||||||
|
# - GPL-2.0-or-later
|
||||||
|
# - GPL-3.0-only
|
||||||
|
# - Apache-2.0
|
||||||
|
# - CC-BY-4.0
|
||||||
|
license: license (GPL-2.0-or-later, MIT, etc)
|
||||||
|
|
||||||
platforms:
|
min_ansible_version: 2.1
|
||||||
- name: Fedora
|
|
||||||
versions:
|
|
||||||
- all
|
|
||||||
|
|
||||||
- name: EL
|
# If this a Container Enabled role, provide the minimum Ansible Container version.
|
||||||
versions:
|
# min_ansible_container_version:
|
||||||
- "8"
|
|
||||||
- "9"
|
#
|
||||||
|
# Provide a list of supported platforms, and for each platform a list of versions.
|
||||||
|
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
|
||||||
|
# To view available platforms and versions (or releases), visit:
|
||||||
|
# https://galaxy.ansible.com/api/v1/platforms/
|
||||||
|
#
|
||||||
|
# platforms:
|
||||||
|
# - name: Fedora
|
||||||
|
# versions:
|
||||||
|
# - all
|
||||||
|
# - 25
|
||||||
|
# - name: SomePlatform
|
||||||
|
# versions:
|
||||||
|
# - all
|
||||||
|
# - 1.0
|
||||||
|
# - 7
|
||||||
|
# - 99.99
|
||||||
|
|
||||||
galaxy_tags: []
|
galaxy_tags: []
|
||||||
# List tags for your role here, one per line. A tag is a keyword that describes
|
# List tags for your role here, one per line. A tag is a keyword that describes
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
block:
|
block:
|
||||||
- name: Include distribution specific variables
|
- name: Include distribution specific variables
|
||||||
include_vars:
|
include_vars:
|
||||||
file: "{{ ansible_distribution | lower }}_{{ ansible_distribution_major_version }}.yml"
|
file: "{{ ansible_distribution | regex_replace('\\s+', '_') | lower }}_{{ ansible_distribution_major_version }}.yml"
|
||||||
|
|
||||||
|
|
||||||
rescue:
|
rescue:
|
||||||
- name: Non-supported distribution; using default package set
|
- name: Non-supported distribution; using default package set
|
||||||
@ -12,14 +11,6 @@
|
|||||||
file: __default_packages.yml
|
file: __default_packages.yml
|
||||||
|
|
||||||
|
|
||||||
- name: Install EPEL for CentOS hosts - Required for some of our packages
|
|
||||||
package:
|
|
||||||
name : epel-release
|
|
||||||
state : present
|
|
||||||
when:
|
|
||||||
- ansible_distribution | lower == 'centos'
|
|
||||||
|
|
||||||
|
|
||||||
- name: Install package set
|
- name: Install package set
|
||||||
package:
|
package:
|
||||||
name : "{{ __base_packages }}"
|
name : "{{ __base_packages }}"
|
||||||
|
0
roles/base_packages/templates/.keep
Normal file
0
roles/base_packages/templates/.keep
Normal file
@ -9,6 +9,7 @@ __base_packages:
|
|||||||
- ftp
|
- ftp
|
||||||
- git
|
- git
|
||||||
- htop
|
- htop
|
||||||
|
- ipa-client
|
||||||
- iperf
|
- iperf
|
||||||
- iptraf
|
- iptraf
|
||||||
- jwhois
|
- jwhois
|
||||||
|
@ -10,6 +10,7 @@ __base_packages:
|
|||||||
- ftp
|
- ftp
|
||||||
- git
|
- git
|
||||||
- htop
|
- htop
|
||||||
|
- ipa-client
|
||||||
- iperf3
|
- iperf3
|
||||||
- iptraf
|
- iptraf
|
||||||
- lsof
|
- lsof
|
||||||
|
@ -9,6 +9,7 @@ __base_packages:
|
|||||||
- ftp
|
- ftp
|
||||||
- git
|
- git
|
||||||
- htop
|
- htop
|
||||||
|
- ipa-client
|
||||||
- iperf3
|
- iperf3
|
||||||
- iptraf
|
- iptraf
|
||||||
- lsof
|
- lsof
|
||||||
|
22
roles/base_packages/vars/opensuse_tumbleweed_20220324.yml
Normal file
22
roles/base_packages/vars/opensuse_tumbleweed_20220324.yml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
__base_packages:
|
||||||
|
- bc
|
||||||
|
- bzip2
|
||||||
|
- file
|
||||||
|
- ftp
|
||||||
|
- git
|
||||||
|
- iptraf
|
||||||
|
- mlocate
|
||||||
|
- lsof
|
||||||
|
- rsync
|
||||||
|
- sudo
|
||||||
|
- tar
|
||||||
|
- tcpdump
|
||||||
|
- telnet
|
||||||
|
- traceroute
|
||||||
|
- tree
|
||||||
|
- unzip
|
||||||
|
- wget
|
||||||
|
- whois
|
||||||
|
- zip
|
||||||
|
|
@ -1,38 +0,0 @@
|
|||||||
Role Name
|
|
||||||
=========
|
|
||||||
|
|
||||||
A brief description of the role goes here.
|
|
||||||
|
|
||||||
Requirements
|
|
||||||
------------
|
|
||||||
|
|
||||||
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
|
|
||||||
|
|
||||||
Role Variables
|
|
||||||
--------------
|
|
||||||
|
|
||||||
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
|
|
||||||
|
|
||||||
Dependencies
|
|
||||||
------------
|
|
||||||
|
|
||||||
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
|
|
||||||
|
|
||||||
Example Playbook
|
|
||||||
----------------
|
|
||||||
|
|
||||||
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
|
|
||||||
|
|
||||||
- hosts: servers
|
|
||||||
roles:
|
|
||||||
- { role: username.rolename, x: 42 }
|
|
||||||
|
|
||||||
License
|
|
||||||
-------
|
|
||||||
|
|
||||||
BSD
|
|
||||||
|
|
||||||
Author Information
|
|
||||||
------------------
|
|
||||||
|
|
||||||
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
|
|
@ -1,4 +0,0 @@
|
|||||||
export PS1='\[\033[38;5;081m\]\u\[\033[38;5;245m\]@\[\033[38;5;206m\]\H \[\033[38;5;245m\]\w\[\033[38;5;206m\]$ \[\e[0m\]'
|
|
||||||
|
|
||||||
alias ansible-playbook="time /usr/bin/ansible-playbook"
|
|
||||||
alias tm="clear;tail -F /var/log/messages"
|
|
@ -1,29 +0,0 @@
|
|||||||
galaxy_info:
|
|
||||||
author: Chris Hammer
|
|
||||||
description: Deploys a standard .bashrc file for the root user for each inventory host.
|
|
||||||
|
|
||||||
license: GPL-2.0-or-later
|
|
||||||
|
|
||||||
min_ansible_version: "2.14"
|
|
||||||
|
|
||||||
platforms:
|
|
||||||
- name: Fedora
|
|
||||||
versions:
|
|
||||||
- all
|
|
||||||
|
|
||||||
- name: EL
|
|
||||||
versions:
|
|
||||||
- "8"
|
|
||||||
- "9"
|
|
||||||
|
|
||||||
galaxy_tags: []
|
|
||||||
# List tags for your role here, one per line. A tag is a keyword that describes
|
|
||||||
# and categorizes the role. Users find roles by searching for tags. Be sure to
|
|
||||||
# remove the '[]' above, if you add tags to this list.
|
|
||||||
#
|
|
||||||
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
|
|
||||||
# Maximum 20 tags per role.
|
|
||||||
|
|
||||||
dependencies: []
|
|
||||||
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
|
|
||||||
# if you add dependencies to this list.
|
|
@ -1,9 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Deploy .bashrc
|
|
||||||
copy:
|
|
||||||
src : files/bashrc
|
|
||||||
dest : /root/.bashrc
|
|
||||||
mode : 0640
|
|
||||||
|
|
||||||
|
|
||||||
...
|
|
@ -1,2 +0,0 @@
|
|||||||
localhost
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
- hosts: localhost
|
|
||||||
remote_user: root
|
|
||||||
roles:
|
|
||||||
- bashrc
|
|
@ -1,38 +0,0 @@
|
|||||||
Role Name
|
|
||||||
=========
|
|
||||||
|
|
||||||
A brief description of the role goes here.
|
|
||||||
|
|
||||||
Requirements
|
|
||||||
------------
|
|
||||||
|
|
||||||
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
|
|
||||||
|
|
||||||
Role Variables
|
|
||||||
--------------
|
|
||||||
|
|
||||||
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
|
|
||||||
|
|
||||||
Dependencies
|
|
||||||
------------
|
|
||||||
|
|
||||||
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
|
|
||||||
|
|
||||||
Example Playbook
|
|
||||||
----------------
|
|
||||||
|
|
||||||
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
|
|
||||||
|
|
||||||
- hosts: servers
|
|
||||||
roles:
|
|
||||||
- { role: username.rolename, x: 42 }
|
|
||||||
|
|
||||||
License
|
|
||||||
-------
|
|
||||||
|
|
||||||
BSD
|
|
||||||
|
|
||||||
Author Information
|
|
||||||
------------------
|
|
||||||
|
|
||||||
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
|
|
@ -1,2 +0,0 @@
|
|||||||
---
|
|
||||||
# defaults file for default_services
|
|
@ -1,29 +0,0 @@
|
|||||||
galaxy_info:
|
|
||||||
author: Chris Hammer
|
|
||||||
description: Defines the state (enabled/started) of a defined set of services for each inventory host.
|
|
||||||
|
|
||||||
license: GPL-2.0-or-later
|
|
||||||
|
|
||||||
min_ansible_version: "2.14"
|
|
||||||
|
|
||||||
platforms:
|
|
||||||
- name: Fedora
|
|
||||||
versions:
|
|
||||||
- all
|
|
||||||
|
|
||||||
- name: EL
|
|
||||||
versions:
|
|
||||||
- "8"
|
|
||||||
- "9"
|
|
||||||
|
|
||||||
galaxy_tags: []
|
|
||||||
# List tags for your role here, one per line. A tag is a keyword that describes
|
|
||||||
# and categorizes the role. Users find roles by searching for tags. Be sure to
|
|
||||||
# remove the '[]' above, if you add tags to this list.
|
|
||||||
#
|
|
||||||
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
|
|
||||||
# Maximum 20 tags per role.
|
|
||||||
|
|
||||||
dependencies: []
|
|
||||||
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
|
|
||||||
# if you add dependencies to this list.
|
|
@ -1,2 +0,0 @@
|
|||||||
---
|
|
||||||
# tasks file for default_services
|
|
@ -1,2 +0,0 @@
|
|||||||
localhost
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
- hosts: localhost
|
|
||||||
remote_user: root
|
|
||||||
roles:
|
|
||||||
- default_services
|
|
@ -8,6 +8,7 @@ __template_header : The Zen Garden
|
|||||||
|
|
||||||
|
|
||||||
__etc_hosts_file : /etc/hosts
|
__etc_hosts_file : /etc/hosts
|
||||||
|
__etc_hosts_file_docker : /etc/hosts.docker
|
||||||
__etc_hosts_version : 1.0.0
|
__etc_hosts_version : 1.0.0
|
||||||
__etc_hosts_revision : 22314
|
__etc_hosts_revision : 22314
|
||||||
|
|
||||||
|
0
roles/etc_hosts/files/.keep
Normal file
0
roles/etc_hosts/files/.keep
Normal file
@ -1,22 +1,43 @@
|
|||||||
galaxy_info:
|
galaxy_info:
|
||||||
author: Chris Hammer
|
author: your name
|
||||||
description: |
|
description: your role description
|
||||||
"Deploys a standardized /etc/hosts file for each inventory host. Includes \
|
company: your company (optional)
|
||||||
support for custom host entries."
|
|
||||||
|
|
||||||
license: GPL-2.0-or-later
|
# If the issue tracker for your role is not on github, uncomment the
|
||||||
|
# next line and provide a value
|
||||||
|
# issue_tracker_url: http://example.com/issue/tracker
|
||||||
|
|
||||||
min_ansible_version: "2.14"
|
# Choose a valid license ID from https://spdx.org - some suggested licenses:
|
||||||
|
# - BSD-3-Clause (default)
|
||||||
|
# - MIT
|
||||||
|
# - GPL-2.0-or-later
|
||||||
|
# - GPL-3.0-only
|
||||||
|
# - Apache-2.0
|
||||||
|
# - CC-BY-4.0
|
||||||
|
license: license (GPL-2.0-or-later, MIT, etc)
|
||||||
|
|
||||||
platforms:
|
min_ansible_version: 2.1
|
||||||
- name: Fedora
|
|
||||||
versions:
|
|
||||||
- all
|
|
||||||
|
|
||||||
- name: EL
|
# If this a Container Enabled role, provide the minimum Ansible Container version.
|
||||||
versions:
|
# min_ansible_container_version:
|
||||||
- "8"
|
|
||||||
- "9"
|
#
|
||||||
|
# Provide a list of supported platforms, and for each platform a list of versions.
|
||||||
|
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
|
||||||
|
# To view available platforms and versions (or releases), visit:
|
||||||
|
# https://galaxy.ansible.com/api/v1/platforms/
|
||||||
|
#
|
||||||
|
# platforms:
|
||||||
|
# - name: Fedora
|
||||||
|
# versions:
|
||||||
|
# - all
|
||||||
|
# - 25
|
||||||
|
# - name: SomePlatform
|
||||||
|
# versions:
|
||||||
|
# - all
|
||||||
|
# - 1.0
|
||||||
|
# - 7
|
||||||
|
# - 99.99
|
||||||
|
|
||||||
galaxy_tags: []
|
galaxy_tags: []
|
||||||
# List tags for your role here, one per line. A tag is a keyword that describes
|
# List tags for your role here, one per line. A tag is a keyword that describes
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
- name: Set etc_hosts_file if running in Docker
|
- name: Set etc_hosts_file if running in Docker
|
||||||
set_fact:
|
set_fact:
|
||||||
etc_hosts_file: "{{ __etc_hosts_file }}.docker"
|
etc_hosts_file: "{{ __etc_hosts_file_docker }}"
|
||||||
when:
|
when:
|
||||||
- ansible_virtualization_type == "docker"
|
- ansible_virtualization_type == "docker"
|
||||||
|
|
||||||
|
2
roles/etc_hosts/vars/main.yml
Normal file
2
roles/etc_hosts/vars/main.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
# vars file for etc_hosts
|
@ -1,38 +0,0 @@
|
|||||||
Role Name
|
|
||||||
=========
|
|
||||||
|
|
||||||
A brief description of the role goes here.
|
|
||||||
|
|
||||||
Requirements
|
|
||||||
------------
|
|
||||||
|
|
||||||
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
|
|
||||||
|
|
||||||
Role Variables
|
|
||||||
--------------
|
|
||||||
|
|
||||||
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
|
|
||||||
|
|
||||||
Dependencies
|
|
||||||
------------
|
|
||||||
|
|
||||||
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
|
|
||||||
|
|
||||||
Example Playbook
|
|
||||||
----------------
|
|
||||||
|
|
||||||
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
|
|
||||||
|
|
||||||
- hosts: servers
|
|
||||||
roles:
|
|
||||||
- { role: username.rolename, x: 42 }
|
|
||||||
|
|
||||||
License
|
|
||||||
-------
|
|
||||||
|
|
||||||
BSD
|
|
||||||
|
|
||||||
Author Information
|
|
||||||
------------------
|
|
||||||
|
|
||||||
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
|
|
@ -1,43 +0,0 @@
|
|||||||
---
|
|
||||||
- name: restart_syslog_centos_7
|
|
||||||
service:
|
|
||||||
name : rsyslog
|
|
||||||
state : restarted
|
|
||||||
|
|
||||||
- name: restart_syslog_centos_8
|
|
||||||
service:
|
|
||||||
name : syslog
|
|
||||||
state : restarted
|
|
||||||
|
|
||||||
- name: restart_syslog_centos_9
|
|
||||||
service:
|
|
||||||
name : rsyslog
|
|
||||||
state : restarted
|
|
||||||
|
|
||||||
- name: restart_syslog_redhat_8
|
|
||||||
service:
|
|
||||||
name : rsyslog
|
|
||||||
state : restarted
|
|
||||||
|
|
||||||
- name: restart_syslog_redhat_9
|
|
||||||
service:
|
|
||||||
name : rsyslog
|
|
||||||
state : restarted
|
|
||||||
|
|
||||||
- name: restart_syslog_debian_11
|
|
||||||
service:
|
|
||||||
name : rsyslog
|
|
||||||
state : restarted
|
|
||||||
|
|
||||||
- name: restart_syslog_fedora_35
|
|
||||||
service:
|
|
||||||
name : rsyslog
|
|
||||||
state : restarted
|
|
||||||
|
|
||||||
- name: restart_syslog_fedora_38
|
|
||||||
service:
|
|
||||||
name : rsyslog
|
|
||||||
state : started
|
|
||||||
|
|
||||||
|
|
||||||
...
|
|
@ -1,29 +0,0 @@
|
|||||||
galaxy_info:
|
|
||||||
author: Chris Hammer
|
|
||||||
description: Sets the system hostname to inventory hostname for target host
|
|
||||||
|
|
||||||
license: GPL-2.0-or-later
|
|
||||||
|
|
||||||
min_ansible_version: "2.14"
|
|
||||||
|
|
||||||
platforms:
|
|
||||||
- name: Fedora
|
|
||||||
versions:
|
|
||||||
- all
|
|
||||||
|
|
||||||
- name: EL
|
|
||||||
versions:
|
|
||||||
- "8"
|
|
||||||
- "9"
|
|
||||||
|
|
||||||
galaxy_tags: []
|
|
||||||
# List tags for your role here, one per line. A tag is a keyword that describes
|
|
||||||
# and categorizes the role. Users find roles by searching for tags. Be sure to
|
|
||||||
# remove the '[]' above, if you add tags to this list.
|
|
||||||
#
|
|
||||||
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
|
|
||||||
# Maximum 20 tags per role.
|
|
||||||
|
|
||||||
dependencies: []
|
|
||||||
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
|
|
||||||
# if you add dependencies to this list.
|
|
@ -1,9 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Set hostname for host
|
|
||||||
hostname:
|
|
||||||
name: "{{ inventory_hostname }}"
|
|
||||||
notify:
|
|
||||||
- "restart_syslog_{{ ansible_distribution | lower }}_{{ ansible_distribution_major_version }}"
|
|
||||||
|
|
||||||
|
|
||||||
...
|
|
@ -1,2 +0,0 @@
|
|||||||
localhost
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
- hosts: localhost
|
|
||||||
remote_user: root
|
|
||||||
roles:
|
|
||||||
- hostname
|
|
0
roles/motd/files/.keep
Normal file
0
roles/motd/files/.keep
Normal file
2
roles/motd/handlers/main.yml
Normal file
2
roles/motd/handlers/main.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
# handlers file for motd
|
@ -1,20 +1,43 @@
|
|||||||
galaxy_info:
|
galaxy_info:
|
||||||
author: Chris Hammer
|
author: your name
|
||||||
description: Deploys a custom /etc/motd on each inventory host
|
description: your role description
|
||||||
|
company: your company (optional)
|
||||||
|
|
||||||
license: GPL-2.0-or-later
|
# If the issue tracker for your role is not on github, uncomment the
|
||||||
|
# next line and provide a value
|
||||||
|
# issue_tracker_url: http://example.com/issue/tracker
|
||||||
|
|
||||||
min_ansible_version: "2.14"
|
# Choose a valid license ID from https://spdx.org - some suggested licenses:
|
||||||
|
# - BSD-3-Clause (default)
|
||||||
|
# - MIT
|
||||||
|
# - GPL-2.0-or-later
|
||||||
|
# - GPL-3.0-only
|
||||||
|
# - Apache-2.0
|
||||||
|
# - CC-BY-4.0
|
||||||
|
license: license (GPL-2.0-or-later, MIT, etc)
|
||||||
|
|
||||||
platforms:
|
min_ansible_version: 2.1
|
||||||
- name: Fedora
|
|
||||||
versions:
|
|
||||||
- all
|
|
||||||
|
|
||||||
- name: EL
|
# If this a Container Enabled role, provide the minimum Ansible Container version.
|
||||||
versions:
|
# min_ansible_container_version:
|
||||||
- "8"
|
|
||||||
- "9"
|
#
|
||||||
|
# Provide a list of supported platforms, and for each platform a list of versions.
|
||||||
|
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
|
||||||
|
# To view available platforms and versions (or releases), visit:
|
||||||
|
# https://galaxy.ansible.com/api/v1/platforms/
|
||||||
|
#
|
||||||
|
# platforms:
|
||||||
|
# - name: Fedora
|
||||||
|
# versions:
|
||||||
|
# - all
|
||||||
|
# - 25
|
||||||
|
# - name: SomePlatform
|
||||||
|
# versions:
|
||||||
|
# - all
|
||||||
|
# - 1.0
|
||||||
|
# - 7
|
||||||
|
# - 99.99
|
||||||
|
|
||||||
galaxy_tags: []
|
galaxy_tags: []
|
||||||
# List tags for your role here, one per line. A tag is a keyword that describes
|
# List tags for your role here, one per line. A tag is a keyword that describes
|
||||||
|
@ -1,29 +1,21 @@
|
|||||||
---
|
---
|
||||||
- name: Set host IP address or set a default
|
- name: Set host IP address or set a default
|
||||||
set_fact:
|
set_fact:
|
||||||
host_ip : "{{ ansible_default_ipv4.address | default('127.0.0.1') }}"
|
host_ip: "{{ ansible_default_ipv4.address | default('127.0.0.1') }}"
|
||||||
|
|
||||||
|
|
||||||
- name: Install Perl if needed
|
- name: Get system uptime - Script
|
||||||
package:
|
script: "scripts/get_uptime.pl {{ ansible_uptime_seconds }}"
|
||||||
name : perl
|
register: node_uptime
|
||||||
state : present
|
changed_when: false
|
||||||
|
|
||||||
|
|
||||||
- name: Get system uptime from script
|
|
||||||
script:
|
|
||||||
cmd : "scripts/get_uptime.pl {{ ansible_uptime_seconds }}"
|
|
||||||
register : node_uptime
|
|
||||||
changed_when : false
|
|
||||||
|
|
||||||
|
|
||||||
- name: Update MOTD
|
- name: Update MOTD
|
||||||
template:
|
template:
|
||||||
src : templates/motd.j2
|
src: templates/motd.j2
|
||||||
dest : "{{ __motd_file }}"
|
dest: "{{ __motd_file }}"
|
||||||
mode : 0644
|
mode: 0644
|
||||||
changed_when : false
|
changed_when: false
|
||||||
|
|
||||||
|
|
||||||
...
|
...
|
||||||
|
|
||||||
|
2
roles/motd/vars/main.yml
Normal file
2
roles/motd/vars/main.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
# vars file for motd
|
@ -1,38 +0,0 @@
|
|||||||
Role Name
|
|
||||||
=========
|
|
||||||
|
|
||||||
A brief description of the role goes here.
|
|
||||||
|
|
||||||
Requirements
|
|
||||||
------------
|
|
||||||
|
|
||||||
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
|
|
||||||
|
|
||||||
Role Variables
|
|
||||||
--------------
|
|
||||||
|
|
||||||
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
|
|
||||||
|
|
||||||
Dependencies
|
|
||||||
------------
|
|
||||||
|
|
||||||
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
|
|
||||||
|
|
||||||
Example Playbook
|
|
||||||
----------------
|
|
||||||
|
|
||||||
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
|
|
||||||
|
|
||||||
- hosts: servers
|
|
||||||
roles:
|
|
||||||
- { role: username.rolename, x: 42 }
|
|
||||||
|
|
||||||
License
|
|
||||||
-------
|
|
||||||
|
|
||||||
BSD
|
|
||||||
|
|
||||||
Author Information
|
|
||||||
------------------
|
|
||||||
|
|
||||||
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
|
|
@ -1,2 +0,0 @@
|
|||||||
---
|
|
||||||
# defaults file for node_status
|
|
@ -1,2 +0,0 @@
|
|||||||
---
|
|
||||||
# handlers file for node_status
|
|
@ -1,29 +0,0 @@
|
|||||||
galaxy_info:
|
|
||||||
author: Chris Hammer
|
|
||||||
description: We do nothing for now.
|
|
||||||
|
|
||||||
license: GPL-2.0-or-later
|
|
||||||
|
|
||||||
min_ansible_version: "2.14"
|
|
||||||
|
|
||||||
platforms:
|
|
||||||
- name: Fedora
|
|
||||||
versions:
|
|
||||||
- all
|
|
||||||
|
|
||||||
- name: EL
|
|
||||||
versions:
|
|
||||||
- "8"
|
|
||||||
- "9"
|
|
||||||
|
|
||||||
galaxy_tags: []
|
|
||||||
# List tags for your role here, one per line. A tag is a keyword that describes
|
|
||||||
# and categorizes the role. Users find roles by searching for tags. Be sure to
|
|
||||||
# remove the '[]' above, if you add tags to this list.
|
|
||||||
#
|
|
||||||
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
|
|
||||||
# Maximum 20 tags per role.
|
|
||||||
|
|
||||||
dependencies: []
|
|
||||||
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
|
|
||||||
# if you add dependencies to this list.
|
|
@ -1,2 +0,0 @@
|
|||||||
---
|
|
||||||
# tasks file for node_status
|
|
@ -1,2 +0,0 @@
|
|||||||
localhost
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
- hosts: localhost
|
|
||||||
remote_user: root
|
|
||||||
roles:
|
|
||||||
- node_status
|
|
@ -1,2 +0,0 @@
|
|||||||
---
|
|
||||||
# vars file for node_status
|
|
@ -9,14 +9,14 @@ __template_header : The Zen Garden
|
|||||||
|
|
||||||
__resolv_conf_file : /etc/resolv.conf
|
__resolv_conf_file : /etc/resolv.conf
|
||||||
__resolv_conf_file_docker : /etc/resolv.conf.docker
|
__resolv_conf_file_docker : /etc/resolv.conf.docker
|
||||||
__resolv_conf_version : 1.0.1
|
__resolv_conf_version : 1.0.0
|
||||||
__resolv_conf_revision : 221007
|
__resolv_conf_revision : 22315
|
||||||
|
|
||||||
|
|
||||||
__search_domain : thezengarden.net
|
__search_domain : thezengarden.net
|
||||||
__nameservers :
|
__nameservers :
|
||||||
- 10.10.10.55
|
- 10.10.10.55
|
||||||
- 10.1.1.15
|
- 10.1.1.210
|
||||||
|
|
||||||
|
|
||||||
...
|
...
|
||||||
|
0
roles/resolv_conf/files/.keep
Normal file
0
roles/resolv_conf/files/.keep
Normal file
2
roles/resolv_conf/handlers/main.yml
Normal file
2
roles/resolv_conf/handlers/main.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
# handlers file for resolv_conf
|
@ -1,20 +1,43 @@
|
|||||||
galaxy_info:
|
galaxy_info:
|
||||||
author: Chris Hammer
|
author: your name
|
||||||
description: Deploys a standard /etc/resolv.conf on each inventory host.
|
description: your role description
|
||||||
|
company: your company (optional)
|
||||||
|
|
||||||
license: GPL-2.0-or-later
|
# If the issue tracker for your role is not on github, uncomment the
|
||||||
|
# next line and provide a value
|
||||||
|
# issue_tracker_url: http://example.com/issue/tracker
|
||||||
|
|
||||||
min_ansible_version: "2.14"
|
# Choose a valid license ID from https://spdx.org - some suggested licenses:
|
||||||
|
# - BSD-3-Clause (default)
|
||||||
|
# - MIT
|
||||||
|
# - GPL-2.0-or-later
|
||||||
|
# - GPL-3.0-only
|
||||||
|
# - Apache-2.0
|
||||||
|
# - CC-BY-4.0
|
||||||
|
license: license (GPL-2.0-or-later, MIT, etc)
|
||||||
|
|
||||||
platforms:
|
min_ansible_version: 2.1
|
||||||
- name: Fedora
|
|
||||||
versions:
|
|
||||||
- all
|
|
||||||
|
|
||||||
- name: EL
|
# If this a Container Enabled role, provide the minimum Ansible Container version.
|
||||||
versions:
|
# min_ansible_container_version:
|
||||||
- "8"
|
|
||||||
- "9"
|
#
|
||||||
|
# Provide a list of supported platforms, and for each platform a list of versions.
|
||||||
|
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
|
||||||
|
# To view available platforms and versions (or releases), visit:
|
||||||
|
# https://galaxy.ansible.com/api/v1/platforms/
|
||||||
|
#
|
||||||
|
# platforms:
|
||||||
|
# - name: Fedora
|
||||||
|
# versions:
|
||||||
|
# - all
|
||||||
|
# - 25
|
||||||
|
# - name: SomePlatform
|
||||||
|
# versions:
|
||||||
|
# - all
|
||||||
|
# - 1.0
|
||||||
|
# - 7
|
||||||
|
# - 99.99
|
||||||
|
|
||||||
galaxy_tags: []
|
galaxy_tags: []
|
||||||
# List tags for your role here, one per line. A tag is a keyword that describes
|
# List tags for your role here, one per line. A tag is a keyword that describes
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
###############################################
|
||||||
# {{ __template_header }}
|
# {{ __template_header }}
|
||||||
###############################################
|
###############################################
|
||||||
#
|
#
|
||||||
|
2
roles/resolv_conf/vars/main.yml
Normal file
2
roles/resolv_conf/vars/main.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
# vars file for resolv_conf
|
@ -1,38 +0,0 @@
|
|||||||
Role Name
|
|
||||||
=========
|
|
||||||
|
|
||||||
A brief description of the role goes here.
|
|
||||||
|
|
||||||
Requirements
|
|
||||||
------------
|
|
||||||
|
|
||||||
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
|
|
||||||
|
|
||||||
Role Variables
|
|
||||||
--------------
|
|
||||||
|
|
||||||
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
|
|
||||||
|
|
||||||
Dependencies
|
|
||||||
------------
|
|
||||||
|
|
||||||
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
|
|
||||||
|
|
||||||
Example Playbook
|
|
||||||
----------------
|
|
||||||
|
|
||||||
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
|
|
||||||
|
|
||||||
- hosts: servers
|
|
||||||
roles:
|
|
||||||
- { role: username.rolename, x: 42 }
|
|
||||||
|
|
||||||
License
|
|
||||||
-------
|
|
||||||
|
|
||||||
BSD
|
|
||||||
|
|
||||||
Author Information
|
|
||||||
------------------
|
|
||||||
|
|
||||||
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
|
|
@ -1,23 +0,0 @@
|
|||||||
---
|
|
||||||
__project_author : Chris Hammer
|
|
||||||
__project_email : chris@thezengarden.net
|
|
||||||
__project_repo : https://github.com/jchristianh-ansible-collections/baseos
|
|
||||||
|
|
||||||
|
|
||||||
__template_header : The Zen Garden
|
|
||||||
|
|
||||||
|
|
||||||
__snmpd_conf_file : /etc/snmp/snmpd.conf
|
|
||||||
__snmpd_conf_version : 1.0.0
|
|
||||||
__snmpd_conf_revision : 22404
|
|
||||||
|
|
||||||
|
|
||||||
__snmp_pkg : net-snmp
|
|
||||||
|
|
||||||
|
|
||||||
__snmpd_location : 'Newport News, VA'
|
|
||||||
__snmpd_contact_name : 'Chris Hammer'
|
|
||||||
__snmpd_contact_email : '<chris@thezengarden.net>'
|
|
||||||
|
|
||||||
|
|
||||||
...
|
|
@ -1,6 +0,0 @@
|
|||||||
---
|
|
||||||
- name: restart snmpd
|
|
||||||
service:
|
|
||||||
name : snmpd
|
|
||||||
state: restarted
|
|
||||||
when: ansible_virtualization_type != "docker"
|
|
@ -1,29 +0,0 @@
|
|||||||
galaxy_info:
|
|
||||||
author: Chris Hammer
|
|
||||||
description: Deploy SNMPd with a standard configuration on each inventory host.
|
|
||||||
|
|
||||||
license: GPL-2.0-or-later
|
|
||||||
|
|
||||||
min_ansible_version: "2.14"
|
|
||||||
|
|
||||||
platforms:
|
|
||||||
- name: Fedora
|
|
||||||
versions:
|
|
||||||
- all
|
|
||||||
|
|
||||||
- name: EL
|
|
||||||
versions:
|
|
||||||
- "8"
|
|
||||||
- "9"
|
|
||||||
|
|
||||||
galaxy_tags: []
|
|
||||||
# List tags for your role here, one per line. A tag is a keyword that describes
|
|
||||||
# and categorizes the role. Users find roles by searching for tags. Be sure to
|
|
||||||
# remove the '[]' above, if you add tags to this list.
|
|
||||||
#
|
|
||||||
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
|
|
||||||
# Maximum 20 tags per role.
|
|
||||||
|
|
||||||
dependencies: []
|
|
||||||
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
|
|
||||||
# if you add dependencies to this list.
|
|
@ -1,41 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Include distribution specific variables or include defaults
|
|
||||||
block:
|
|
||||||
- name: Include distribution specific variables
|
|
||||||
include_vars:
|
|
||||||
file: "{{ ansible_distribution | lower }}_{{ ansible_distribution_major_version }}.yml"
|
|
||||||
|
|
||||||
|
|
||||||
rescue:
|
|
||||||
- name: Non-supported distribution; using default package set
|
|
||||||
include_vars:
|
|
||||||
file: __default_packages.yml
|
|
||||||
|
|
||||||
|
|
||||||
- name: Deploy and configure SNMP
|
|
||||||
block:
|
|
||||||
- name: Install SNMP
|
|
||||||
package:
|
|
||||||
name: "{{ __snmp_pkg }}"
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Ensure /etc/snmp directory is present
|
|
||||||
file:
|
|
||||||
path: /etc/snmp
|
|
||||||
state: directory
|
|
||||||
|
|
||||||
- name: Deploy snmpd.conf
|
|
||||||
template:
|
|
||||||
src: templates/snmpd_conf.j2
|
|
||||||
dest: "{{ __snmpd_conf_file }}"
|
|
||||||
mode: 0644
|
|
||||||
notify: restart snmpd
|
|
||||||
|
|
||||||
|
|
||||||
rescue:
|
|
||||||
- name: Unable to deploy SNMP
|
|
||||||
debug:
|
|
||||||
msg: "Unable to deploy SNMP to {{ inventory_hostname }}."
|
|
||||||
|
|
||||||
|
|
||||||
...
|
|
@ -1,38 +0,0 @@
|
|||||||
###############################################
|
|
||||||
# {{ __template_header }}
|
|
||||||
###############################################
|
|
||||||
#
|
|
||||||
# Configuration : {{ __snmpd_conf_file }}
|
|
||||||
# Template Version : {{ __snmpd_conf_version}}-{{ __snmpd_conf_revision }}
|
|
||||||
#
|
|
||||||
# {{ __project_author }} ({{ __project_email }})
|
|
||||||
###############################################
|
|
||||||
|
|
||||||
|
|
||||||
com2sec readonly default public
|
|
||||||
|
|
||||||
group MyROSystem v1 paranoid
|
|
||||||
group MyROSystem v2c paranoid
|
|
||||||
group MyROSystem usm paranoid
|
|
||||||
group MyROGroup v1 readonly
|
|
||||||
group MyROGroup v2c readonly
|
|
||||||
group MyROGroup usm readonly
|
|
||||||
group MyRWGroup v1 readwrite
|
|
||||||
group MyRWGroup v2c readwrite
|
|
||||||
group MyRWGroup usm readwrite
|
|
||||||
|
|
||||||
view all included .1 80
|
|
||||||
view system included .iso.org.dod.internet.mgmt.mib-2.system
|
|
||||||
|
|
||||||
# context sec.model sec.level match read write notif
|
|
||||||
access MyROSystem "" any noauth exact system none none
|
|
||||||
access MyROGroup "" any noauth exact all none none
|
|
||||||
access MyRWGroup "" any noauth exact all all none
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# System contact information
|
|
||||||
#
|
|
||||||
syslocation {{ __snmpd_location }}
|
|
||||||
syscontact {{ __snmpd_contact_name }} {{ __snmpd_contact_email }}
|
|
||||||
# -----------------------------------------------------------------------------
|
|
@ -1,2 +0,0 @@
|
|||||||
localhost
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
- hosts: localhost
|
|
||||||
remote_user: root
|
|
||||||
roles:
|
|
||||||
- snmpd_conf
|
|
@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
__snmp_pkg: net-snmp
|
|
||||||
|
|
||||||
|
|
||||||
...
|
|
@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
__snmp_pkg: net-snmp
|
|
||||||
|
|
||||||
|
|
||||||
...
|
|
@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
__snmp_pkg: net-snmp
|
|
||||||
|
|
||||||
|
|
||||||
...
|
|
@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
__snmp_pkg: net-snmp
|
|
||||||
|
|
||||||
|
|
||||||
...
|
|
@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
__snmp_pkg: snmpd
|
|
||||||
|
|
||||||
|
|
||||||
...
|
|
2
roles/update_all_packages/defaults/main.yml
Normal file
2
roles/update_all_packages/defaults/main.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
# defaults file for roles/update_all_packages
|
0
roles/update_all_packages/files/.keep
Normal file
0
roles/update_all_packages/files/.keep
Normal file
2
roles/update_all_packages/handlers/main.yml
Normal file
2
roles/update_all_packages/handlers/main.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
# handlers file for roles/update_all_packages
|
@ -1,20 +1,43 @@
|
|||||||
galaxy_info:
|
galaxy_info:
|
||||||
author: Chris Hammer
|
author: your name
|
||||||
description: Updates all packages on each inventory host to their latest versions.
|
description: your role description
|
||||||
|
company: your company (optional)
|
||||||
|
|
||||||
license: GPL-2.0-or-later
|
# If the issue tracker for your role is not on github, uncomment the
|
||||||
|
# next line and provide a value
|
||||||
|
# issue_tracker_url: http://example.com/issue/tracker
|
||||||
|
|
||||||
min_ansible_version: "2.14"
|
# Choose a valid license ID from https://spdx.org - some suggested licenses:
|
||||||
|
# - BSD-3-Clause (default)
|
||||||
|
# - MIT
|
||||||
|
# - GPL-2.0-or-later
|
||||||
|
# - GPL-3.0-only
|
||||||
|
# - Apache-2.0
|
||||||
|
# - CC-BY-4.0
|
||||||
|
license: license (GPL-2.0-or-later, MIT, etc)
|
||||||
|
|
||||||
platforms:
|
min_ansible_version: 2.1
|
||||||
- name: Fedora
|
|
||||||
versions:
|
|
||||||
- all
|
|
||||||
|
|
||||||
- name: EL
|
# If this a Container Enabled role, provide the minimum Ansible Container version.
|
||||||
versions:
|
# min_ansible_container_version:
|
||||||
- "8"
|
|
||||||
- "9"
|
#
|
||||||
|
# Provide a list of supported platforms, and for each platform a list of versions.
|
||||||
|
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
|
||||||
|
# To view available platforms and versions (or releases), visit:
|
||||||
|
# https://galaxy.ansible.com/api/v1/platforms/
|
||||||
|
#
|
||||||
|
# platforms:
|
||||||
|
# - name: Fedora
|
||||||
|
# versions:
|
||||||
|
# - all
|
||||||
|
# - 25
|
||||||
|
# - name: SomePlatform
|
||||||
|
# versions:
|
||||||
|
# - all
|
||||||
|
# - 1.0
|
||||||
|
# - 7
|
||||||
|
# - 99.99
|
||||||
|
|
||||||
galaxy_tags: []
|
galaxy_tags: []
|
||||||
# List tags for your role here, one per line. A tag is a keyword that describes
|
# List tags for your role here, one per line. A tag is a keyword that describes
|
||||||
|
@ -1,26 +1,5 @@
|
|||||||
---
|
---
|
||||||
- name: Update package cache for Debian hosts
|
- name: Update all packages on host
|
||||||
apt:
|
|
||||||
update_cache: yes
|
|
||||||
when:
|
|
||||||
- ansible_distribution|lower == 'debian'
|
|
||||||
tags:
|
|
||||||
- skip_ansible_lint
|
|
||||||
|
|
||||||
|
|
||||||
- name: Update package cache for RHEL/CentOS/Fedora hosts
|
|
||||||
dnf:
|
|
||||||
update_cache: yes
|
|
||||||
when:
|
|
||||||
- (ansible_distribution|lower == 'centos' or
|
|
||||||
ansible_distribution|lower == 'fedora' or
|
|
||||||
ansible_distribution|lower == 'redhat')
|
|
||||||
- ansible_distribution_major_version|int >= 8
|
|
||||||
tags:
|
|
||||||
- skip_ansible_lint
|
|
||||||
|
|
||||||
|
|
||||||
- name: Update all host packages
|
|
||||||
package: name=* state=latest
|
package: name=* state=latest
|
||||||
tags:
|
tags:
|
||||||
- skip_ansible_lint
|
- skip_ansible_lint
|
||||||
|
0
roles/update_all_packages/templates/.keep
Normal file
0
roles/update_all_packages/templates/.keep
Normal file
2
roles/update_all_packages/vars/main.yml
Normal file
2
roles/update_all_packages/vars/main.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
# vars file for roles/update_all_packages
|
Loading…
x
Reference in New Issue
Block a user