Add tests and fix structure to prevent errors
This commit is contained in:
parent
a057c34d94
commit
7b259dc86a
7 changed files with 26 additions and 3 deletions
101
playbooks/deploy.yml
Normal file
101
playbooks/deploy.yml
Normal file
|
@ -0,0 +1,101 @@
|
|||
---
|
||||
|
||||
- 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
|
||||
|
||||
- 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
|
Loading…
Add table
Add a link
Reference in a new issue