--- - name: "deploy workstation" hosts: localhost connection: local become: true become_method: sudo vars_files: - vars.yml roles: - cups - firefox - git - google-chrome - kerberos - ldap - mutt - rpmfusion-nonfree-repo - spotify - thinlinc - thunderbird tasks: - name: check hostname ansible.builtin.command: argv: - hostnamectl - hostname - --static register: hostname_check changed_when: false - name: set hostname ansible.builtin.command: argv: - hostnamectl - hostname - --static - >- {{ lookup( 'password', '/dev/null chars=ascii_lowercase,digits length=4' ) }} when: hostname_check.stdout == "" - name: remove unneeded packages ansible.builtin.package: name: "{{ item }}" state: absent with_items: - abrt - mlocate - name: install extra packages ansible.builtin.package: name: "{{ item }}" state: installed with_items: - emacs # more editors - gstreamer1-plugin-openh264 # h264 plugin for browser - podman-docker # add docker compatibility - python3-ansible-lint # linter for ansible - ShellCheck # check shell scripts for errors - steam # for gaming - strace # program debugging - telegram-desktop # telegram client - vim # better vi - virt-manager # manage virtual machines - yamllint # linter for yaml files - name: check for nvidia gpu ansible.builtin.shell: cmd: lspci -d '0x10de:' -n | grep -E '^[0-9]+:[0-9]+\.[0-9]+ 0300:' register: nvidia_check failed_when: false check_mode: false changed_when: false - name: install nvidia gpu drivers ansible.builtin.include_role: name: nvidia-driver when: nvidia_check.rc == 0 - name: hide grub menu during boot ansible.builtin.lineinfile: path: /etc/default/grub line: GRUB_TIMEOUT_STYLE=hidden regexp: "^GRUB_TIMEOUT_STYLE=.*" notify: reconfigure grub handlers: - name: reconfigure grub ansible.builtin.command: argv: - grub2-mkconfig - -o - /boot/grub2/grub.cfg