Giter Site home page Giter Site logo

ansible_audit_module's Introduction

Get diff hosts

Exmaple reports from playbook/audit_pckg/.report:

  1. packages
  2. services
  3. system
  4. mount

How to run

ansible-playbook -D playbook/audit_pckg/audit_pckg.yml -l my_host_group

Report

Reports generating in block

  - name: generate html
    template:
      src: html.j2
      dest: "{{ audit_pckg_folder_html_report }}/{{ item.key }}.html"
    delegate_to: localhost
    loop: "{{ compared_result['meta'] | dict2items }}"
    run_once: True

Options for module

Output of module is dict

  - name: compare facts
    compare_facts:
      services: "{{ my_services }}"
      packages: "{{ my_packages }}"
      mounts: "{{ my_mounts }}"
      mounts_filter:
        - /
        - /boot
      system: "{{ my_system }}"
      dest_raw: "{{ audit_pckg_folder_json_raw }}"
      dest_result: "{{ audit_pckg_folder_json_result }}"
    register: compared_result
    delegate_to: localhost
    run_once: True

data

  • required atleast one
services

Systemd list

  - name: set global var
    set_fact:
      my_services: "{{ my_services | default ({}) | combine( { item: hostvars[item].ansible_facts.services} ) }}"
    delegate_to: localhost
    run_once: True
    loop: "{{ ansible_play_hosts }}"
packages

Yum packages

  - name: set global var
    set_fact:
      my_packages: "{{ my_packages | default ({}) | combine( { item: hostvars[item].ansible_facts.packages} ) }}"
    delegate_to: localhost
    run_once: True
    loop: "{{ ansible_play_hosts }}"
mounts

Mount points

  - name: set global var
    set_fact:
      my_mounts: "{{ my_mounts | default ({}) | combine( { item: hostvars[item].ansible_mounts} ) }}"
    delegate_to: localhost
    run_once: True
    loop: "{{ ansible_play_hosts }}"
system

System release

  - name: set global var
    set_fact:
      my_system: "{{ my_system | default ({}) | combine( { item: {hostvars[item].ansible_distribution: hostvars[item].ansible_distribution_version} }) }}"
    delegate_to: localhost
    run_once: True
    loop: "{{ ansible_play_hosts }}"

dest_raw

dest_result

mounts_filter

  • Optional Filter for mount points

ansible_audit_module's People

Contributors

happyfx avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

abousidibe

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.