initial checkin

This commit is contained in:
Radar231 2021-07-23 18:45:46 -04:00
commit bd4a950c8c
6 changed files with 176 additions and 0 deletions

30
base_pkgs.yml Normal file
View File

@ -0,0 +1,30 @@
---
###########################################################################
#
# This is the top level playbook for the 'base_pkgs' role. This role will
# install a selected set of packages as a desired baseline package
# collection.
#
# There is a separate (but as similar as possible) package list for Ubuntu
# and CentOS based hosts.
#
###########################################################################
#
# This playbook can be run using the following command line;
#
# ansible-playbook -i <inventory file | IP,> base_pkgs.yml
#
# ie,
# ansible-playbook -i 192.168.1.123, base_pkgs.yml
#
###########################################################################
- hosts: all
gather_facts: true
user: root
roles:
- update_cache
- base_pkgs
# EOF

33
bash_mods.yml Normal file
View File

@ -0,0 +1,33 @@
---
###########################################################################
#
# This is the top level playbook for the 'bash_mods' role. This role will
# apply our desired bash configuration.
#
###########################################################################
#
# This playbook can be run using the following command line;
#
# ansible-playbook -i <inventory file | IP,> -e "username=<username>" -e "homedir=<home dir>" bash_mods.yml
#
# ie,
# ansible-playbook -i 192.168.1.123, -e "username=ubuntu" -e "homedir=/home/ubuntu" bash_mods.yml
#
###########################################################################
- hosts: all
gather_facts: true
user: root
roles:
- role: bash_mods
vars:
# Set the following two variables as required
# ie,
# username: ubuntu
# homedir: /home/ubuntu
# Default is to apply the playbook against the root user
username: "root"
homedir: "/root"
# EOF

29
chk_upgrades.yml Normal file
View File

@ -0,0 +1,29 @@
---
###########################################################################
#
# This is the top level playbook for the 'chk_upgrades' role.
#
# This role will check for available package upgrades on the target host.
#
# This role should work on both Ubuntu and CentOS based hosts.
#
###########################################################################
#
# This playbook can be run using the following command line;
#
# ansible-playbook -i <inventory file | IP,> chk_upgrades.yml
#
# ie,
# ansible-playbook -i 192.168.1.123, check_upgrades.yml
#
###########################################################################
- hosts: all
gather_facts: true
user: root
roles:
- update_cache
- chk_upgrades
# EOF

35
create_user.yml Normal file
View File

@ -0,0 +1,35 @@
---
###########################################################
#
# This is the top level playbook for the 'create_user' role. This playbook will
# prompt the user for a username and password for a new user, and will create
# a new user account with that name and password set.
#
###########################################################
#
# This playbook can be run using the following command line;
#
# ansible-playbook -i <inventory file | IP,> create_user.yml
#
# ie,
# ansible-playbook -i 192.168.1.123, create_user.yml
#
###########################################################
- hosts: all
gather_facts: true
user: root
vars_prompt:
- name: username
prompt: "Please enter the name for the new user"
private: false
- name: userpw
prompt: "Please enter the password for the new user"
private: true
roles:
- role: create_user
# EOF

27
rem_base_pkgs.yml Normal file
View File

@ -0,0 +1,27 @@
---
###########################################################################
#
# This is the top level playbook for the 'rem_base_pkgs' role.
#
# This role removes the packages install in the 'base_pkgs' role. This is
# used for testing the 'base_pkgs' role.
###########################################################################
#
# This playbook can be run using the following command line;
#
# ansible-playbook -i <inventory file | IP,> rem_base_pkgs.yml
#
# ie,
# ansible-playbook -i 192.168.1.123, rem_base_pkgs.yml
#
###########################################################################
- hosts: all
gather_facts: true
user: root
roles:
- rem_base_pkgs
# EOF

22
run_role.yml Normal file
View File

@ -0,0 +1,22 @@
---
#####################################################################
#
# This is a generic playbook to allow running a single role, withou
# having to create a specific high level playbook.
#
# Note:
#
# This playbook requires that you set the variable 'myrole' when calling
# as well setting any other variables that may be required by the role
# being called.
#
#####################################################################
- hosts: all
gather_facts: true
user: root
roles:
- role: "{{ myrole }}"
# EOF