switched to lists instead loops

This commit is contained in:
kashapovd 2021-10-29 05:26:00 +00:00
parent 60b0bdff25
commit 79d547fcf9
2 changed files with 15 additions and 65 deletions

View File

@ -1,55 +1,22 @@
---
# tasks file for install-packages
- block: # red hat based distros
- yum: name={{item}} state=latest update_cache=True
with_items:
- iptables-services
- iperf3
- git
- zsh
- vim
- wget
- epel-release
- bmon
- curl
- tcpdump
- nmap
- mc
- nano
- iptraf-ng
- yum:
name: ['iptables-services', 'iperf3', 'git', 'zsh', 'vim', 'wget', 'epel-release', 'bmon', 'curl', 'tcpdump', 'nmap', 'mc', 'nano', 'iptraf-ng']
state: latest
update_cache: True
when: ansible_os_family == "RedHat"
- block: # debian based distros
- apt: name={{item}} state=latest update_cache=True
with_items:
- iperf3
- git
- zsh
- vim
- wget
- bmon
- curl
- tcpdump
- nmap
- nano
- mc
- iptraf-ng
- apt:
name: ['iperf3', 'git', 'zsh', 'vim', 'wget', 'bmon', 'curl', 'tcpdump', 'nmap', 'nano', 'mc', 'iptraf-ng']
state: latest
update_cache: True
when: ansible_os_family == "Debian"
- block: # alpine
- apk: name={{item}} state=latest update_cache=True
with_items:
- git
- zsh
- zsh-vcs
- vim
- wget
- curl
- tcpdump
- nmap
- bmon
- shadow
- nano
- mc
- iptraf-ng
- apk:
name: ['git', 'zsh', 'zsh-vcs', 'vim', 'wget', 'curl', 'tcpdump', 'nmap', 'bmon', 'shadow', 'nano', 'mc', 'iptraf-ng']
state: latest
update_cache: True
when: ansible_os_family == "Alpine"

View File

@ -1,40 +1,23 @@
---
- block: #red hat based distros
- yum:
name: '{{ item }}'
name: ['git', 'zsh', 'vim', 'wget']
state: latest
update_cache: true
with_items:
- git
- zsh
- vim
- wget
when: ansible_os_family == "RedHat" and install_deps == true and update_only == false
- block: #debian based distros
- apt:
name: '{{ item }}'
name: ['git', 'zsh', 'vim', 'wget']
state: latest
update_cache: true
with_items:
- git
- zsh
- vim
- wget
when: ansible_os_family == "Debian" and install_deps == true and update_only == false
- block: #alpine
- apk:
name: '{{ item }}'
name: ['git', 'zsh', 'vim', 'wget', 'zsh-vcs', 'shadow']
state: latest
update_cache: true
with_items:
- git
- zsh
- vim
- wget
- zsh-vcs
- shadow
when: ansible_os_family == "Alpine" and install_deps == true and update_only == false
- name: change default shell