install-software.yml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. ---
  2. - hosts: test_group
  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. register: libinstall
  71. - debug: msg="{{ libinstall }}"
  72. #- name: Copy Offcie 2019 archive file with owner and permission
  73. # ansible.builtin.copy:
  74. # src: /home/vidikon/2019x64.tar.gz
  75. # dest: /tmp/2019x64.tar.gz
  76. # owner: user
  77. # group: user
  78. # mode: u=rw,g=r,o=r
  79. #- name: Extract Office.tar.gz into /tmp
  80. # ansible.builtin.shell: tar xvfz /tmp/2019x64.tar.gz