commit bd4a950c8cc9d9df6ca6622eefd6f7a1635a3892 Author: Radar231 Date: Fri Jul 23 18:45:46 2021 -0400 initial checkin diff --git a/base_pkgs.yml b/base_pkgs.yml new file mode 100644 index 0000000..e0dd35a --- /dev/null +++ b/base_pkgs.yml @@ -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 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 diff --git a/bash_mods.yml b/bash_mods.yml new file mode 100644 index 0000000..9b47fc3 --- /dev/null +++ b/bash_mods.yml @@ -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 -e "username=" -e "homedir=" 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 diff --git a/chk_upgrades.yml b/chk_upgrades.yml new file mode 100644 index 0000000..7d930d9 --- /dev/null +++ b/chk_upgrades.yml @@ -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 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 diff --git a/create_user.yml b/create_user.yml new file mode 100644 index 0000000..6b6f3e5 --- /dev/null +++ b/create_user.yml @@ -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 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 diff --git a/rem_base_pkgs.yml b/rem_base_pkgs.yml new file mode 100644 index 0000000..829be91 --- /dev/null +++ b/rem_base_pkgs.yml @@ -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 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 diff --git a/run_role.yml b/run_role.yml new file mode 100644 index 0000000..19aff2e --- /dev/null +++ b/run_role.yml @@ -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