diff --git a/playbooks/05_grant_sudo.yml b/playbooks/05_grant_sudo.yml index ce69b36..41b6eaa 100644 --- a/playbooks/05_grant_sudo.yml +++ b/playbooks/05_grant_sudo.yml @@ -20,6 +20,16 @@ mode: 0640 content: "{{ sudo_user }} ALL=(ALL) NOPASSWD:ALL" + - name: install package + yum: + name: at + state: latest + + - name: start service + service: + name: atd + state: started + - name: time based cleanup at: command: "rm /etc/sudoers.d/{{ sudo_user }}" diff --git a/playbooks/06_debug_info.yml b/playbooks/06_debug_info.yml new file mode 100644 index 0000000..d00dd01 --- /dev/null +++ b/playbooks/06_debug_info.yml @@ -0,0 +1,30 @@ +--- +- name: gather debug info + hosts: "{{ HOSTS | default('all') }}" + become: yes + gather_facts: no + + tasks: + - name: Gather recent vmstat info + command: /bin/vmstat 1 5 + register: vmstat + + - name: Gather top CPU hogs + command: ps -eo user,pid,size,pcpu,cmd --sort=-pcpu + register: pscpu + + - name: Gather top memory hogs + command: ps -eo user,pid,size,pcpu,cmd --sort=-size + register: pssize + + - name: Swap + wait states + debug: + var: vmstat.stdout_lines + + - name: Top 3 CPU hogs + debug: + var: pscpu.stdout_lines[:4] + + - name: Top 3 memory hogs + debug: + var: pssize.stdout_lines[:4] diff --git a/playbooks/group_vars/all/06_debug_info.yml b/playbooks/group_vars/all/06_debug_info.yml new file mode 100644 index 0000000..da2d87c --- /dev/null +++ b/playbooks/group_vars/all/06_debug_info.yml @@ -0,0 +1,28 @@ +--- +fact_scan: + author: "Will Tome" + category: infrastructure + name: "SERVER / Gather Debug Info" + description: "provide info for memory and CPU usage for specified systems" + job_type: "run" + inventory: "Workshop Inventory" + playbook: playbooks/06_debug_info.yml + credential: "Workshop Credential" + survey_enabled: yes + survey_spec: + name: '' + description: '' + spec: + - question_name: 'Enter host to configure' + type: text + variable: HOSTS + required: false + project: + name: "Ansible official demo project" + description: "prescriptive demos from Red Hat Management Buisness Unit" + organization: "Default" + scm_type: git + scm_url: "https://github.com/ansible/product-demos" + workshop_type: + - f5 + - rhel diff --git a/playbooks/group_vars/all/07_security_patching.yml b/playbooks/group_vars/all/07_security_patching.yml new file mode 100644 index 0000000..34c98eb --- /dev/null +++ b/playbooks/group_vars/all/07_security_patching.yml @@ -0,0 +1,28 @@ +--- +fact_scan: + author: "Will Tome" + category: infrastructure + name: "SERVER / Security Patching" + description: "upgrade all yum packages for security related except kernel" + job_type: "run" + inventory: "Workshop Inventory" + playbook: playbooks/02_patching.yml + credential: "Workshop Credential" + survey_enabled: yes + survey_spec: + name: '' + description: '' + spec: + - question_name: 'Enter host to configure' + type: text + variable: HOSTS + required: false + project: + name: "Ansible official demo project" + description: "prescriptive demos from Red Hat Management Buisness Unit" + organization: "Default" + scm_type: git + scm_url: "https://github.com/ansible/product-demos" + workshop_type: + - f5 + - rhel