Replace with_items for loop

It's the new way, apparently
This commit is contained in:
Jake Howard 2019-12-09 21:09:00 +00:00
parent 2bd33855e9
commit ab945b0a48
Signed by: jake
GPG key ID: 57AFB45680EDD477
22 changed files with 51 additions and 45 deletions

View file

@ -5,7 +5,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- 'virtualbox-host-modules-arch' - 'virtualbox-host-modules-arch'
- 'virtualbox-guest-modules-arch' - 'virtualbox-guest-modules-arch'
@ -16,7 +16,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- 'bleachbit' - 'bleachbit'
- 'brave-bin' - 'brave-bin'
- 'clamtk' - 'clamtk'

View file

@ -5,7 +5,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- 'dex' - 'dex'
- name: "Create autostart directory" - name: "Create autostart directory"
@ -23,7 +23,7 @@
owner: "{{ user }}" owner: "{{ user }}"
state: link state: link
force: true force: true
with_items: loop:
- 'pulseaudio' - 'pulseaudio'
- 'nm-applet' - 'nm-applet'
- 'lxqt-policykit-agent' - 'lxqt-policykit-agent'
@ -37,6 +37,6 @@
owner: "{{ user }}" owner: "{{ user }}"
state: link state: link
force: true force: true
with_items: loop:
- 'flameshot' - 'flameshot'
- 'libinput-gestures' - 'libinput-gestures'

View file

@ -5,7 +5,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- 'grub-customizer' - 'grub-customizer'
- 'grub2-theme-archlinux' - 'grub2-theme-archlinux'
- 'lightdm' - 'lightdm'
@ -38,7 +38,9 @@
option: "{{ item.key }}" option: "{{ item.key }}"
value: "{{ item.value }}" value: "{{ item.value }}"
mode: 0644 mode: 0644
with_items: loop_control:
label: "{{ item.key }}"
loop:
- {key: "background", value: "/usr/share/backgrounds/gnome/adwaita-night.jpg"} - {key: "background", value: "/usr/share/backgrounds/gnome/adwaita-night.jpg"}
- {key: "theme-name", value: "Matcha-dark-aliz"} - {key: "theme-name", value: "Matcha-dark-aliz"}
- {key: "icon-theme-name", value: "Numix-Square"} - {key: "icon-theme-name", value: "Numix-Square"}
@ -52,7 +54,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- dosfstools - dosfstools
- exfat-utils - exfat-utils
- hfsprogs - hfsprogs
@ -65,6 +67,6 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- 'amd-ucode' - 'amd-ucode'
- 'intel-ucode' - 'intel-ucode'

View file

@ -5,7 +5,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- 'heroku-cli' - 'heroku-cli'
- 'ngrok' - 'ngrok'
- 'python-aws-mfa' - 'python-aws-mfa'

View file

@ -5,7 +5,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- 'biber' - 'biber'
- 'pandoc-bin' - 'pandoc-bin'
- 'texlive-most' - 'texlive-most'
@ -17,7 +17,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- 'arduino' - 'arduino'
- 'arduino-cli' - 'arduino-cli'
- 'arduino-builder' - 'arduino-builder'

View file

@ -5,7 +5,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- 'all-repository-fonts' - 'all-repository-fonts'
- 'fonts-meta-extended-lt' - 'fonts-meta-extended-lt'
- 'otf-fira-code' - 'otf-fira-code'
@ -22,7 +22,7 @@
dest: "/etc/fonts/conf.d/{{ item }}" dest: "/etc/fonts/conf.d/{{ item }}"
mode: 0644 mode: 0644
state: link state: link
with_items: loop:
- '11-lcdfilter-default.conf' - '11-lcdfilter-default.conf'
- '10-sub-pixel-rgb.conf' - '10-sub-pixel-rgb.conf'
- '30-infinality-aliases.conf' - '30-infinality-aliases.conf'

View file

@ -14,7 +14,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- baobab - baobab
- cheese - cheese
- eog - eog
@ -37,7 +37,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- 'gtk-engine-murrine' - 'gtk-engine-murrine'
- 'lxappearance' - 'lxappearance'
- 'numix-gtk-theme-git' - 'numix-gtk-theme-git'
@ -96,7 +96,7 @@
owner: "{{ user }}" owner: "{{ user }}"
state: link state: link
force: true force: true
with_items: loop:
- 'org.gnome.SettingsDaemon.XSettings' - 'org.gnome.SettingsDaemon.XSettings'
- 'org.gnome.SettingsDaemon.DiskUtilityNotify' - 'org.gnome.SettingsDaemon.DiskUtilityNotify'
- 'org.gnome.SettingsDaemon.Keyboard' - 'org.gnome.SettingsDaemon.Keyboard'

View file

@ -5,7 +5,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- 'arandr' - 'arandr'
- 'betterlockscreen' - 'betterlockscreen'
- 'brightnessctl' - 'brightnessctl'
@ -37,7 +37,9 @@
- {src: "polybar.ini", dest: "{{ home }}/.config/polybar/config"} - {src: "polybar.ini", dest: "{{ home }}/.config/polybar/config"}
- name: "Create i3 config file directories" - name: "Create i3 config file directories"
with_items: "{{ i3_config_files }}" loop: "{{ i3_config_files }}"
loop_control:
label: "{{ item.src }}"
file: file:
path: '{{ item.dest | dirname }}' path: '{{ item.dest | dirname }}'
state: directory state: directory
@ -45,7 +47,9 @@
mode: 0755 mode: 0755
- name: "i3 config files" - name: "i3 config files"
with_items: "{{ i3_config_files }}" loop: "{{ i3_config_files }}"
loop_control:
label: "{{ item.src }}"
template: template:
src: './files/{{ item.src }}' src: './files/{{ item.src }}'
dest: '{{ item.dest }}' dest: '{{ item.dest }}'

View file

@ -5,7 +5,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- 'gpointing-device-settings' - 'gpointing-device-settings'
- 'ibus' - 'ibus'
- 'ibus-uniemoji' - 'ibus-uniemoji'

View file

@ -5,7 +5,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- 'calibre' - 'calibre'
- 'deluge' - 'deluge'
- 'feedreader' - 'feedreader'

View file

@ -5,6 +5,6 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- 'nodejs' - 'nodejs'
- 'nvm' - 'nvm'

View file

@ -5,7 +5,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- mbpfan-git - mbpfan-git
- bcwc-pcie-git - bcwc-pcie-git

View file

@ -5,7 +5,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- 'ffmpeg-compat-57' - 'ffmpeg-compat-57'
- 'spotify' - 'spotify'
@ -16,7 +16,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- 'bcm20702a1-firmware' - 'bcm20702a1-firmware'
- 'bluez-firmware' - 'bluez-firmware'
- 'bluez-utils-compat' - 'bluez-utils-compat'
@ -30,7 +30,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- alsa-utils - alsa-utils
- pavucontrol - pavucontrol
- pulseaudio - pulseaudio

View file

@ -5,7 +5,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- 'bind-tools' - 'bind-tools'
- 'gnu-netcat' - 'gnu-netcat'
- 'nmap' - 'nmap'
@ -17,7 +17,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- 'networkmanager' - 'networkmanager'
- 'network-manager-applet' - 'network-manager-applet'

View file

@ -5,7 +5,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- ntp - ntp
- name: Set timezone - name: Set timezone

View file

@ -24,19 +24,19 @@
- name: "Add keys to pacman" - name: "Add keys to pacman"
shell: "pacman-key -r {{ item }}" shell: "pacman-key -r {{ item }}"
when: "item not in pacman_keys.stdout" when: "item not in pacman_keys.stdout"
with_items: "{{ keys }}" loop: "{{ keys }}"
- name: "Sign keys in pacman" - name: "Sign keys in pacman"
shell: "pacman-key --lsign-key {{ item }}" shell: "pacman-key --lsign-key {{ item }}"
when: "item not in pacman_keys.stdout" when: "item not in pacman_keys.stdout"
with_items: "{{ keys }}" loop: "{{ keys }}"
- name: "Add keys to local keyring" - name: "Add keys to local keyring"
shell: "gpg --recv-keys {{ item }}" shell: "gpg --recv-keys {{ item }}"
become: true become: true
become_user: "{{ user }}" become_user: "{{ user }}"
when: "item not in known_gpg_keys.stdout" when: "item not in known_gpg_keys.stdout"
with_items: "{{ keys }}" loop: "{{ keys }}"
- name: Create aur_builder user - name: Create aur_builder user
user: user:
@ -73,7 +73,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- 'archstrike-keyring' - 'archstrike-keyring'
- name: "Install ccache" - name: "Install ccache"

View file

@ -5,7 +5,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- 'acpi' - 'acpi'
- ethtool - ethtool
- nbfc - nbfc
@ -20,7 +20,7 @@
systemd: systemd:
name: "{{ item }}" name: "{{ item }}"
enabled: true enabled: true
with_items: loop:
- tlp - tlp
- tlp-sleep - tlp-sleep

View file

@ -5,7 +5,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- 'pyenv' - 'pyenv'
- 'python-pip' - 'python-pip'
- 'python-virtualenv' - 'python-virtualenv'

View file

@ -5,7 +5,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- 'enpass-bin' - 'enpass-bin'
- 'qomui' - 'qomui'
- 'wireguard-arch' - 'wireguard-arch'

View file

@ -5,7 +5,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- 'advanced-ssh-config' - 'advanced-ssh-config'
- 'alacritty' - 'alacritty'
- 'alacritty-terminfo' - 'alacritty-terminfo'
@ -79,7 +79,7 @@
force: true force: true
become: true become: true
become_user: "{{ user }}" become_user: "{{ user }}"
with_items: loop:
- https://github.com/jimeh/tmux-themepack - https://github.com/jimeh/tmux-themepack
- https://github.com/tmux-plugins/tmux-yank - https://github.com/tmux-plugins/tmux-yank
- https://github.com/tmux-plugins/tmux-sensible - https://github.com/tmux-plugins/tmux-sensible

View file

@ -5,7 +5,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- 'gvim' - 'gvim'
- 'vim-pathogen' - 'vim-pathogen'
@ -39,7 +39,7 @@
force: true force: true
become: true become: true
become_user: "{{ user }}" become_user: "{{ user }}"
with_items: loop:
- 'https://github.com/junegunn/goyo.vim' - 'https://github.com/junegunn/goyo.vim'
- 'https://github.com/itchyny/lightline.vim' - 'https://github.com/itchyny/lightline.vim'
- 'https://github.com/scrooloose/nerdtree' - 'https://github.com/scrooloose/nerdtree'

View file

@ -5,7 +5,7 @@
become: true become: true
become_user: aur_builder become_user: aur_builder
when: "item not in installed_packages.stdout_lines" when: "item not in installed_packages.stdout_lines"
with_items: loop:
- 'visual-studio-code-bin' - 'visual-studio-code-bin'
- 'universal-ctags-git' - 'universal-ctags-git'
@ -83,11 +83,11 @@
become: true become: true
become_user: "{{ user }}" become_user: "{{ user }}"
when: "item not in vscode_extensions.stdout_lines" when: "item not in vscode_extensions.stdout_lines"
with_items: "{{ requested_vscode_extensions }}" loop: "{{ requested_vscode_extensions }}"
- name: "Remove unwanted VSCode extensions" - name: "Remove unwanted VSCode extensions"
shell: "code --uninstall-extension {{ item }}" shell: "code --uninstall-extension {{ item }}"
become: true become: true
become_user: "{{ user }}" become_user: "{{ user }}"
when: "item not in requested_vscode_extensions" when: "item not in requested_vscode_extensions"
with_items: "{{ vscode_extensions.stdout_lines }}" loop: "{{ vscode_extensions.stdout_lines }}"