From 93980ea4c343e3bcd437698fd89ea911b68a8eba Mon Sep 17 00:00:00 2001 From: trevorbryant Date: Mon, 8 Apr 2019 23:03:13 -0400 Subject: [PATCH] playbook the right way --- README.md | 17 ++++-- playbook_apt-sec.yml | 43 ---------------- playbook_apt-utils.yml | 26 ---------- playbook_apt.yml | 114 +++++++++++++++++++++++++++++++++++++++++ playbook_pip-sec.yml | 15 ------ playbook_pip3-sec.yml | 14 ----- 6 files changed, 128 insertions(+), 101 deletions(-) delete mode 100644 playbook_apt-sec.yml delete mode 100644 playbook_apt-utils.yml create mode 100644 playbook_apt.yml delete mode 100644 playbook_pip-sec.yml delete mode 100644 playbook_pip3-sec.yml diff --git a/README.md b/README.md index 5b133ed..52b0038 100644 --- a/README.md +++ b/README.md @@ -25,10 +25,21 @@ $ apt -y install python-apt Perform a dry run: ```bash -$ sudo ansible-playbook playbook_apt-utils.yml --check +$ sudo ansible-playbook playbook_apt.yml --check ``` -Run playbook and install tools to localhost: + +List tasks or tags: +```bash +$ sudo ansible-playbook playbook_apt.yml --list-tasks +``` + +Install or skip specific tasks: +```bash +$ sudo ansible-playbook playbook_apt.yml --tags "deb-utils,pip3-sec" +``` + +Run playbook and all install tools to localhost: ```bash -$ sudo ansible-playbook playbook_apt-utils.yml +$ sudo ansible-playbook playbook_apt.yml ``` diff --git a/playbook_apt-sec.yml b/playbook_apt-sec.yml deleted file mode 100644 index 8c3bcb5..0000000 --- a/playbook_apt-sec.yml +++ /dev/null @@ -1,43 +0,0 @@ -- hosts: localhost - connection: local - become: true - vars: - packages: - - nbtscan - - samba-common-bin - - smbclient - - polenum - - ldap-utils - - samba - - cifs-utils - - python-scapy - - python3-scapy - - scanssh - - zenmap - - sqlmap - - dnsrecon - - ncrack - - onesixtyone - - cewl - - john - - hashcat - - hydra - - recon-ng - - aircrack-ng - - airgraph-ng - - kismet - - wireshark - - tshark - - hunt - - mdbtools - - p7zip-full - - pst-utils - - libimage-exiftool-perl - - steghide - - beef - tasks: - - name: install deb packages - apt: - name: "{{ item }}" - state: present - loop: "{{ packages }}" diff --git a/playbook_apt-utils.yml b/playbook_apt-utils.yml deleted file mode 100644 index 01eabf8..0000000 --- a/playbook_apt-utils.yml +++ /dev/null @@ -1,26 +0,0 @@ -- hosts: localhost - connection: local - become: true - vars: - packages: - - git - - ftp - - jq - - telnet - - netcat - - socat - - rdesktop - - tmux - - vim - - golang-go - - python - - python-pip - - python3 - - python3-pip - - nmap - tasks: - - name: install deb packages - apt: - name: "{{ item }}" - state: present - loop: "{{ packages }}" diff --git a/playbook_apt.yml b/playbook_apt.yml new file mode 100644 index 0000000..71b3af0 --- /dev/null +++ b/playbook_apt.yml @@ -0,0 +1,114 @@ +- name: deb-utils + hosts: localhost + connection: local + become: true + vars: + packages: + - git + - ftp + - jq + - telnet + - netcat + - socat + - rdesktop + - tmux + - vim + - golang-go + - python + - python-pip + - python3 + - python3-pip + - nmap + - docker.io + tasks: + - name: install deb-utils packages + apt: + name: "{{ item }}" + state: present + loop: "{{ packages }}" + tags: + - deb-utils + +- name: deb-sec + hosts: localhost + connection: local + become: true + vars: + packages: + - nbtscan + - samba-common-bin + - smbclient + - polenum + - ldap-utils + - samba + - cifs-utils + - python-scapy + - python3-scapy + - scanssh + - zenmap + - sqlmap + - dnsrecon + - ncrack + - onesixtyone + - cewl + - john + - hashcat + - hydra + - recon-ng + - aircrack-ng + - airgraph-ng + - kismet + - wireshark + - tshark + - hunt + - mdbtools + - pst-utils + - p7zip-full + - libimage-exiftool-perl + - steghide + - beef + tasks: + - name: install deb-sec packages + apt: + name: "{{ item }}" + state: present + loop: "{{ packages }}" + tags: + - deb-sec + +- name: pip-sec + hosts: localhost + connection: local + become: true + vars: + packages: + - impacket + - dirhunt + - crackmapexec + tasks: + - name: install pip-sec packages + pip: + name: "{{ item }}" + state: present + extra_args: --upgrade + loop: "{{ packages }}" + tags: + - pip-sec + +- name: pip3-sec + hosts: localhost + connection: local + become: true + vars: + packages: + - pshtt + tasks: + - name: install pip3-sec packages + pip: + name: "{{ item }}" + executable: pip3 + state: present + extra_args: "{{ packages }}" + loop: "{{ packages }}" + tags: + - pip3-sec diff --git a/playbook_pip-sec.yml b/playbook_pip-sec.yml deleted file mode 100644 index 147be6c..0000000 --- a/playbook_pip-sec.yml +++ /dev/null @@ -1,15 +0,0 @@ -- hosts: localhost - connection: local - become: true - vars: - packages: - - impacket - - dirhunt - - crackmapexec - tasks: - - name: install pip packages - pip: - name: "{{ item }}" - state: present - extra_args: --upgrade - loop: "{{ packages }}" diff --git a/playbook_pip3-sec.yml b/playbook_pip3-sec.yml deleted file mode 100644 index 8a32f08..0000000 --- a/playbook_pip3-sec.yml +++ /dev/null @@ -1,14 +0,0 @@ -- hosts: localhost - connection: local - become: true - vars: - packages: - - pshtt - tasks: - - name: install pip3 packages - pip: - name: "{{ item }}" - executable: pip3 - state: present - extra_args: --upgrade - loop: "{{ packages }}"