install-wine.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. ---
  2. - hosts: test_group
  3. vars:
  4. release: jammy
  5. winetricks_patch: /usr/bin
  6. prefix_dir: /usr/prefixes
  7. prefix_path: /usr/prefixes/msapps
  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. - winbind
  56. - playonlinux
  57. - smbclient
  58. update_cache: yes
  59. when: skipstep == "true"
  60. # - name: Copy winetrics file with owner and permission
  61. # become: true
  62. # ansible.builtin.copy:
  63. # src: "./scripts/winetricks"
  64. # owner: "{{ user_permission }}"
  65. # group: "{{ user_permission }}"
  66. # dest: /usr/bin/winetricks
  67. # mode: u=rwx,g=rwx,o=wrx
  68. - name: Create prefix dir
  69. become: true
  70. block:
  71. - name: Create a directory if it does not exist
  72. ansible.builtin.file:
  73. path: "{{ prefix_dir }}"
  74. owner: "{{ user_permission }}"
  75. group: "{{ user_permission }}"
  76. state: directory
  77. #when: skipstep == "true"
  78. - name: Create prefix and install lib
  79. block:
  80. - name: Create Office prefix
  81. ansible.builtin.shell: wineboot -u
  82. - name: Download lib
  83. ansible.builtin.shell: "{{ winetricks_patch }}/winetricks cmd corefonts msxml6 riched20 gdiplus atmlib msxml3 vcrun2008 vcrun2010 vcrun2012 fontsmooth-rgb gecko"
  84. register: libinstall
  85. - debug: msg="{{ libinstall }}"
  86. environment:
  87. WINEARCH: win32
  88. WINEPREFIX: "{{ prefix_path }}"
  89. # http_proxy: socks5://vidikon:{{ sockspass }}@5.187.2.63:55448
  90. # https_proxy: socks5://vidikon:{{ sockspass }}@5.187.2.63:55448