install-wine.yml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. ---
  2. - hosts: pc8
  3. vars:
  4. release: focal
  5. winetricks_patch: /usr/bin
  6. prefix_dir: /usr/prefixes
  7. prefix_path: /usr/prefixes/msapps
  8. user_permission: oktadmin
  9. officepath: /home/vidikon/ANSIBLE/Office2013.tar.gz
  10. #become: true
  11. gather_facts: no
  12. tasks:
  13. # - name: dpkg --configure -a
  14. # become: true
  15. # ansible.builtin.shell: dpkg --remove --force-remove-reinstreq packettracer
  16. # - name: Upgrade all packets
  17. # become: true
  18. # ansible.builtin.apt:
  19. # name: "*"
  20. # state: latest
  21. - name: wine (add architecture)
  22. become: true
  23. shell:
  24. cmd: dpkg --add-architecture i386
  25. - name: install software-properties-common deb
  26. become: true
  27. ansible.builtin.apt:
  28. pkg:
  29. - software-properties-common
  30. - dirmngr
  31. - ca-certificates
  32. - apt-transport-https
  33. - curl
  34. - name: One way to avoid apt_key once it is removed from your distro
  35. become: true
  36. block:
  37. - name: add key
  38. ansible.builtin.shell: curl -s https://dl.winehq.org/wine-builds/winehq.key | sudo gpg --dearmor | sudo tee /usr/share/keyrings/winehq.gpg > /dev/null
  39. #- name: somerepo |no apt key
  40. # ansible.builtin.get_url:
  41. # url: https://dl.winehq.org/wine-builds/winehq.key
  42. # dest: /usr/share/keyrings/winehq.gpg
  43. - name: add repo
  44. ansible.builtin.apt_repository:
  45. repo: "deb [signed-by=/usr/share/keyrings/winehq.gpg] http://dl.winehq.org/wine-builds/ubuntu/ {{ release }} main"
  46. state: present
  47. - name: install Wine deb
  48. ansible.builtin.apt:
  49. pkg:
  50. - winehq-stable
  51. - winetricks
  52. update_cache: yes
  53. - name: Create prefix dir
  54. become: true
  55. block:
  56. - name: Copy winetrics file with owner and permission
  57. ansible.builtin.copy:
  58. src: "/home/vidikon/ANSIBLE/software-playbooks/scripts/winetricks"
  59. owner: "{{ user_permission }}"
  60. group: "{{ user_permission }}"
  61. dest: /usr/bin/winetricks
  62. mode: u=rwx,g=rwx,o=wr
  63. - name: Create a directory if it does not exist
  64. ansible.builtin.file:
  65. path: "{{ prefix_dir }}"
  66. owner: "{{ user_permission }}"
  67. group: "{{ user_permission }}"
  68. state: directory
  69. - name: Create prefix
  70. block:
  71. # - name: Create Office prefix
  72. # ansible.builtin.shell: env WINEARCH=win32 WINEPREFIX={{ prefix_path }} wineboot -u
  73. # - name: Download font
  74. # ansible.builtin.shell: env WINEARCH=win32 WINEPREFIX={{ prefix_path }} {{ winetricks_patch }}/winetricks corefonts allfonts
  75. - name: Download lib
  76. ansible.builtin.shell: env WINEARCH=win32 WINEPREFIX={{ prefix_path }} {{ winetricks_patch }}/winetricks --torify msxml3 msxml4 msxml6 vcrun2015 dotnet40 gdiplus riched30 mfc42 mfc140 vcrun6
  77. register: libinstall
  78. - debug: msg="{{ libinstall }}"