install-wine.yml 3.2 KB

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