diff options
| author | Romain Gonçalves <me@rgoncalves.se> | 2022-10-22 16:41:45 +0200 | 
|---|---|---|
| committer | Romain Gonçalves <me@rgoncalves.se> | 2022-10-22 16:41:45 +0200 | 
| commit | 0df015e9b5c4aefd4245c94ee98021d2af80ed99 (patch) | |
| tree | d9dbf4259500857daf41b627dbc2d116ba92dbc1 /roles/workstation/tasks | |
| parent | 1cd2d31e0d5f81ce066121de78c0ed042fc3b6aa (diff) | |
| download | rules-0df015e9b5c4aefd4245c94ee98021d2af80ed99.tar.gz | |
lint: pass ansible-lint + yamllint
Diffstat (limited to 'roles/workstation/tasks')
| -rw-r--r-- | roles/workstation/tasks/cronie.yml | 4 | ||||
| -rw-r--r-- | roles/workstation/tasks/doas.yml | 8 | ||||
| -rw-r--r-- | roles/workstation/tasks/dockerd.yml | 12 | ||||
| -rw-r--r-- | roles/workstation/tasks/hosts.yml | 2 | ||||
| -rw-r--r-- | roles/workstation/tasks/libvirt.yml | 6 | ||||
| -rw-r--r-- | roles/workstation/tasks/main.yml | 16 | ||||
| -rw-r--r-- | roles/workstation/tasks/os_archlinux.yml | 16 | ||||
| -rw-r--r-- | roles/workstation/tasks/os_openbsd.yml | 14 | ||||
| -rw-r--r-- | roles/workstation/tasks/pipewire.yml | 12 | ||||
| -rw-r--r-- | roles/workstation/tasks/pkgs.yml | 2 | ||||
| -rw-r--r-- | roles/workstation/tasks/shell.yml | 4 | ||||
| -rw-r--r-- | roles/workstation/tasks/smartcard.yml | 2 | ||||
| -rw-r--r-- | roles/workstation/tasks/ssh.yml | 4 | ||||
| -rw-r--r-- | roles/workstation/tasks/tlp.yml | 4 | ||||
| -rw-r--r-- | roles/workstation/tasks/yay.yml | 7 | 
15 files changed, 57 insertions, 56 deletions
| diff --git a/roles/workstation/tasks/cronie.yml b/roles/workstation/tasks/cronie.yml index 1ac0042..faa1095 100644 --- a/roles/workstation/tasks/cronie.yml +++ b/roles/workstation/tasks/cronie.yml @@ -1,10 +1,10 @@  - name: install cronie -  package: +  ansible.builtin.package:      name: cronie      state: present  - name: enable and restart cronie -  service: +  ansible.builtin.service:      name: cronie      state: restarted      enabled: true diff --git a/roles/workstation/tasks/doas.yml b/roles/workstation/tasks/doas.yml index bc72d7f..e47fa35 100644 --- a/roles/workstation/tasks/doas.yml +++ b/roles/workstation/tasks/doas.yml @@ -1,5 +1,5 @@  - name: generate doas configuration -  lineinfile: +  ansible.builtin.lineinfile:      path: /etc/doas.conf      regexp: "^permit persist keepenv {{ workstation_user }} as root"      line: "permit persist keepenv {{ workstation_user }} as root" @@ -9,7 +9,7 @@      group: 0  - name: allow reboot/shutdown/hibernate with doas -  lineinfile: +  ansible.builtin.lineinfile:      path: /etc/doas.conf      regexp: "^permit nopass {{ workstation_user }} as root cmd {{ item }}"      line: "permit nopass {{ workstation_user }} as root cmd {{ item }}" @@ -21,12 +21,12 @@      - zzz  - name: check sudo binary path  # noqa no-changed-when -  command: command -v sudo +  ansible.builtin.command: command -v sudo    register: result    failed_when: false  - name: uninstall sudo binary -  package: +  ansible.builtin.package:      name: sudo      state: absent    when: result.rc == 0 diff --git a/roles/workstation/tasks/dockerd.yml b/roles/workstation/tasks/dockerd.yml index df85dd5..c0dfd33 100644 --- a/roles/workstation/tasks/dockerd.yml +++ b/roles/workstation/tasks/dockerd.yml @@ -1,18 +1,18 @@  - name: install docker -  package: +  ansible.builtin.package:      name: -    - docker -    - docker-compose +      - docker +      - docker-compose      state: present  - name: append current user to docker group -  user: +  ansible.builtin.user:      name: "{{ workstation_user }}"      groups: "{{ workstation_docker_group }}"      append: true  - name: create docker directory -  file: +  ansible.builtin.file:      path: /etc/docker      state: directory      owner: 0 @@ -20,7 +20,7 @@      mode: 0755  - name: configure default network for docker containers -  template: +  ansible.builtin.template:      src: docker-daemon.json.j2      dest: /etc/docker/daemon.json      owner: 0 diff --git a/roles/workstation/tasks/hosts.yml b/roles/workstation/tasks/hosts.yml index bcc67c6..7cc261a 100644 --- a/roles/workstation/tasks/hosts.yml +++ b/roles/workstation/tasks/hosts.yml @@ -1,5 +1,5 @@  - name: retrieve hosts file -  get_url: +  ansible.builtin.get_url:      url: "{{ workstation_hosts_url }}"      dest: "{{ workstation_hosts_file }}"      mode: '0644' diff --git a/roles/workstation/tasks/libvirt.yml b/roles/workstation/tasks/libvirt.yml index ef9e85b..554f800 100644 --- a/roles/workstation/tasks/libvirt.yml +++ b/roles/workstation/tasks/libvirt.yml @@ -1,9 +1,9 @@  - name: install iptables-nft -  shell: yes | pacman --noprogressbar --needed --sync iptables-nft +  ansible.builtin.shell: yes | pacman --noprogressbar --needed --sync iptables-nft    when: ansible_distribution == "Archlinux"  - name: install libvirt -  package: +  ansible.builtin.package:      name:        - cdrtools        - dnsmasq @@ -12,7 +12,7 @@      state: present  - name: append current user to virt groups -  user: +  ansible.builtin.user:      name: "{{ workstation_user }}"      groups: "{{ item }}"      append: true diff --git a/roles/workstation/tasks/main.yml b/roles/workstation/tasks/main.yml index ea772d6..1c4c463 100644 --- a/roles/workstation/tasks/main.yml +++ b/roles/workstation/tasks/main.yml @@ -1,23 +1,23 @@  - name: include specific distribution variables -  include_vars: "os_{{ ansible_distribution | lower }}.yml" +  ansible.builtin.include_vars: "os_{{ ansible_distribution | lower }}.yml"  - name: include packages -  include_tasks: pkgs.yml +  ansible.builtin.include_tasks: pkgs.yml  - name: include operating system setup -  include_tasks: "os_{{ ansible_distribution | lower }}.yml" +  ansible.builtin.include_tasks: "os_{{ ansible_distribution | lower }}.yml"  - name: include shell setup -  include_tasks: shell.yml +  ansible.builtin.include_tasks: shell.yml  - name: include doas setup -  include_tasks: doas.yml +  ansible.builtin.include_tasks: doas.yml  - name: include smartcard setup -  include_tasks: smartcard.yml +  ansible.builtin.include_tasks: smartcard.yml  - name: include ssh setup -  include_tasks: +  ansible.builtin.include_tasks:      file: ssh.yml    args:      apply: @@ -25,5 +25,5 @@        become_user: "{{ workstation_user }}"  - name: include hosts setup -  include_tasks: +  ansible.builtin.include_tasks:      file: hosts.yml diff --git a/roles/workstation/tasks/os_archlinux.yml b/roles/workstation/tasks/os_archlinux.yml index 488004c..f45433a 100644 --- a/roles/workstation/tasks/os_archlinux.yml +++ b/roles/workstation/tasks/os_archlinux.yml @@ -1,31 +1,31 @@  - name: include battery optimization -  include_tasks: tlp.yml +  ansible.builtin.include_tasks: tlp.yml    when: ansible_form_factor in ["Laptop", "Notebook"]  - name: include cronie setup -  include_tasks: cronie.yml +  ansible.builtin.include_tasks: cronie.yml  - name: include virtualization setup -  include_tasks: libvirt.yml +  ansible.builtin.include_tasks: libvirt.yml  - name: include dockerd setup -  include_tasks: dockerd.yml +  ansible.builtin.include_tasks: dockerd.yml  - name: include pipewire -  include_tasks: pipewire.yml +  ansible.builtin.include_tasks: pipewire.yml  - name: retrieve installed packages -  package_facts: +  ansible.builtin.package_facts:    register: package_facts  - name: include yay -  include_tasks: yay.yml +  ansible.builtin.include_tasks: yay.yml    when:      - "'yay' not in package_facts.ansible_facts.packages"      - "'yay-bin' not in package_facts.ansible_facts.packages"  - name: append current user to system groups -  user: +  ansible.builtin.user:      name: "{{ workstation_user }}"      groups: "{{ item }}"      append: true diff --git a/roles/workstation/tasks/os_openbsd.yml b/roles/workstation/tasks/os_openbsd.yml index d007263..21f3bb1 100644 --- a/roles/workstation/tasks/os_openbsd.yml +++ b/roles/workstation/tasks/os_openbsd.yml @@ -1,5 +1,5 @@  - name: ensure wsconsctl config file exists -  file: +  ansible.builtin.file:      path: /etc/wsconsctl.conf      state: touch      owner: 0 @@ -7,7 +7,7 @@      mode: 0644  - name: append configuration to wsconsctl -  lineinfile: +  ansible.builtin.lineinfile:      path: /etc/wsconsctl.conf      regexp: "^{{ item[0] }}"      line: "{{ item[0] }}={{ item[1] }}" @@ -23,7 +23,7 @@      - [mouse.tp.tapping, 1]  - name: ensure Xorg subdirectory for configuration exists -  file: +  ansible.builtin.file:      path: /etc/X11/xorg.conf.d      owner: 0      group: 0 @@ -31,7 +31,7 @@      state: directory  - name: generate system wide configurations -  template: +  ansible.builtin.template:      src: "{{ item[0] }}"      dest: "{{ item[1] }}"      mode: preserve @@ -42,13 +42,13 @@      - [apm-resume, /etc/apm/resume]  - name: ensure sysctl configuration file exists -  file: +  ansible.builtin.file:      path: /etc/sysctl.conf      owner: root      mode: 0644  - name: ensure sysctl memory optimizations -  blockinfile: +  ansible.builtin.blockinfile:      path: /etc/sysctl.conf      block: |        kern.shminfo.shmall=3145728 @@ -60,7 +60,7 @@      marker: "# memory {mark} - managed by Ansible"  - name: ensure sysctl process optimizations -  blockinfile: +  ansible.builtin.blockinfile:      path: /etc/sysctl.conf      block: |        kern.maxfiles=102400 diff --git a/roles/workstation/tasks/pipewire.yml b/roles/workstation/tasks/pipewire.yml index 8cc3f5e..1fc83a9 100644 --- a/roles/workstation/tasks/pipewire.yml +++ b/roles/workstation/tasks/pipewire.yml @@ -1,14 +1,14 @@  - name: install pipewire -  package: +  ansible.builtin.package:      name: -    - pipewire -    - pipewire-alsa -    - pipewire-pulse -    - mda.lv2 +      - pipewire +      - pipewire-alsa +      - pipewire-pulse +      - mda.lv2      state: present  - name: enable and start pipewire -  systemd: +  ansible.builtin.systemd:      name: "{{ item }}"      scope: user      enabled: true diff --git a/roles/workstation/tasks/pkgs.yml b/roles/workstation/tasks/pkgs.yml index abc583e..674ccc4 100644 --- a/roles/workstation/tasks/pkgs.yml +++ b/roles/workstation/tasks/pkgs.yml @@ -1,5 +1,5 @@  - name: install distribution packages -  package: +  ansible.builtin.package:      name: "{{ item }}"      state: present    loop: diff --git a/roles/workstation/tasks/shell.yml b/roles/workstation/tasks/shell.yml index 42b134c..dc11ca4 100644 --- a/roles/workstation/tasks/shell.yml +++ b/roles/workstation/tasks/shell.yml @@ -1,8 +1,8 @@  - name: retrieve zsh path  # noqa no-changed-when command-instead-of-shell -  shell: command -v zsh +  ansible.builtin.shell: command -v zsh    register: zsh_path  - name: ensure zsh is used for workstation user -  user: +  ansible.builtin.user:      name: "{{ workstation_user }}"      shell: "{{ zsh_path.stdout_lines[0] }}" diff --git a/roles/workstation/tasks/smartcard.yml b/roles/workstation/tasks/smartcard.yml index ed79c92..926770a 100644 --- a/roles/workstation/tasks/smartcard.yml +++ b/roles/workstation/tasks/smartcard.yml @@ -1,5 +1,5 @@  - name: start and enable pcscd service -  service: +  ansible.builtin.service:      name: pcscd      state: started      enabled: true diff --git a/roles/workstation/tasks/ssh.yml b/roles/workstation/tasks/ssh.yml index 318198e..d09c7f8 100644 --- a/roles/workstation/tasks/ssh.yml +++ b/roles/workstation/tasks/ssh.yml @@ -1,5 +1,5 @@  - name: create ssh directory -  file: +  ansible.builtin.file:      path: "/home/{{ workstation_user }}/{{ item }}"      owner: "{{ workstation_user }}"      group: "{{ workstation_user }}" @@ -10,7 +10,7 @@      - .ssh/config.d  - name: generate ssh configuration -  template: +  ansible.builtin.template:      src: ssh.config.j2      dest: "/home/{{ workstation_user }}/.ssh/config.d/dns.config"      owner: "{{ workstation_user }}" diff --git a/roles/workstation/tasks/tlp.yml b/roles/workstation/tasks/tlp.yml index 788f523..4782741 100644 --- a/roles/workstation/tasks/tlp.yml +++ b/roles/workstation/tasks/tlp.yml @@ -1,10 +1,10 @@  - name: install tlp -  package: +  ansible.builtin.package:      name: tlp      state: present  - name: enable and start tlp -  service: +  ansible.builtin.service:      name: tlp      state: started      enabled: true diff --git a/roles/workstation/tasks/yay.yml b/roles/workstation/tasks/yay.yml index cafbc9c..8581bfd 100644 --- a/roles/workstation/tasks/yay.yml +++ b/roles/workstation/tasks/yay.yml @@ -1,5 +1,5 @@  - name: clone yay repository -  git: +  ansible.builtin.git:      repo: "{{ workstation_yay_repo }}"      dest: "{{ workstation_yay_dir }}"      version: origin/master @@ -7,13 +7,14 @@    become_user: "{{ workstation_user }}"  - name: make yay package  # noqa: no-changed-when -  command: +  # possible ambiguous replacement: command : ansible.builtin.command | community.ciscosmb.command | community.routeros.command +  ansible.builtin.command:      cmd: makepkg -fs      chdir: "{{ workstation_yay_dir }}"    become: true    become_user: "{{ workstation_user }}"  - name: install yay package  # noqa: no-changed-when -  shell: +  ansible.builtin.shell:      cmd: pacman --noconfirm -U *.zst      chdir: "{{ workstation_yay_dir }}" |