--- - name: "deploy workstation" hosts: localhost connection: local become: true become_method: sudo vars_files: - ../vars/defaults.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: not hostname_check.stdout - name: remove unneeded packages ansible.builtin.package: name: "{{ item }}" state: absent with_items: - abrt - mlocate - nano-default-editor - name: install extra packages ansible.builtin.package: name: "{{ item }}" state: installed with_items: - brasero # cd/dvd writing - emacs # more editors - gstreamer1-plugin-openh264 # h264 plugin for browser - libvirt-client # virsh client tools - 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