install-software.yml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. ---
  2. - hosts: local
  3. vars:
  4. release: focal
  5. winetricks_patch: /usr/bin/
  6. prefix_dir: /usr/prefixes
  7. prefix_path: /usr/prefixes/msoffice32
  8. user_permission: user
  9. #become: true
  10. gather_facts: no
  11. tasks:
  12. # - name: Upgrade all packets
  13. # become: true
  14. # ansible.builtin.apt:
  15. # name: "*"
  16. # state: latest
  17. # - name: wine (add architecture)
  18. # shell:
  19. # cmd: dpkg --add-architecture i386
  20. - name: install software-properties-common deb
  21. become: true
  22. ansible.builtin.apt:
  23. pkg:
  24. - software-properties-common
  25. - dirmngr
  26. - ca-certificates
  27. - apt-transport-https
  28. - curl
  29. - name: One way to avoid apt_key once it is removed from your distro
  30. become: true
  31. block:
  32. - name: add key
  33. 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
  34. #- name: somerepo |no apt key
  35. # ansible.builtin.get_url:
  36. # url: https://dl.winehq.org/wine-builds/winehq.key
  37. # dest: /usr/share/keyrings/winehq.gpg
  38. - name: add repo
  39. ansible.builtin.apt_repository:
  40. repo: "deb [signed-by=/usr/share/keyrings/winehq.gpg] http://dl.winehq.org/wine-builds/ubuntu/ {{ release }} main"
  41. state: present
  42. - name: install Wine deb
  43. ansible.builtin.apt:
  44. pkg:
  45. - winehq-stable
  46. ## - winetricks
  47. update_cache: yes
  48. - name: Create prefix dir
  49. become: true
  50. block:
  51. - name: download winetricks
  52. ansible.builtin.get_url:
  53. url: https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
  54. dest: "{{ winetricks_patch }}/winetricks"
  55. mode: '0775'
  56. - name: Create a directory if it does not exist
  57. ansible.builtin.file:
  58. path: "{{ prefix_dir }}"
  59. owner: "{{ user_permission }}"
  60. group: "{{ user_permission }}"
  61. state: directory
  62. - name: Create prefix
  63. block:
  64. - name: Create Office prefix
  65. ansible.builtin.shell: env WINEARCH=win32 WINEPREFIX={{ prefix_path }} wineboot -u
  66. - name: Download font
  67. ansible.builtin.shell: env WINEARCH=win32 WINEPREFIX={{ prefix_path }} {{ winetricks_patch }}/winetricks corefonts allfonts
  68. - name: Download lib
  69. ansible.builtin.shell: env WINEARCH=win32 WINEPREFIX={{ prefix_path }} {{ winetricks_patch }}/winetricks msxml3 msxml4 msxml6 vcrun2019 gdiplus riched30 mfc140 vcrun6
  70. #- name: Copy Offcie 2019 archive file with owner and permission
  71. # ansible.builtin.copy:
  72. # src: /home/vidikon/2019x64.tar.gz
  73. # dest: /tmp/2019x64.tar.gz
  74. # owner: user
  75. # group: user
  76. # mode: u=rw,g=r,o=r
  77. #- name: Extract Office.tar.gz into /tmp
  78. # ansible.builtin.shell: tar xvfz /tmp/2019x64.tar.gz