playbook the right way

bionic
trevorbryant 2019-04-08 23:03:13 -04:00
parent 915869f8aa
commit 93980ea4c3
6 changed files with 128 additions and 101 deletions

View File

@ -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
```

View File

@ -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 }}"

View File

@ -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 }}"

114
playbook_apt.yml Normal file
View File

@ -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

View File

@ -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 }}"

View File

@ -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 }}"