install-software.yml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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/msapps
  8. user_permission: user
  9. officepath: /home/vidikon/ANSIBLE/Office2013.tar.gz
  10. #become: true
  11. gather_facts: no
  12. tasks:
  13. - name: Upgrade all packets
  14. become: true
  15. ansible.builtin.apt:
  16. name: "*"
  17. state: latest
  18. - name: wine (add architecture)
  19. shell:
  20. cmd: dpkg --add-architecture i386
  21. - name: install software-properties-common deb
  22. become: true
  23. ansible.builtin.apt:
  24. pkg:
  25. - software-properties-common
  26. - dirmngr
  27. - ca-certificates
  28. - apt-transport-https
  29. - curl
  30. - name: One way to avoid apt_key once it is removed from your distro
  31. become: true
  32. block:
  33. - name: add key
  34. 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
  35. #- name: somerepo |no apt key
  36. # ansible.builtin.get_url:
  37. # url: https://dl.winehq.org/wine-builds/winehq.key
  38. # dest: /usr/share/keyrings/winehq.gpg
  39. - name: add repo
  40. ansible.builtin.apt_repository:
  41. repo: "deb [signed-by=/usr/share/keyrings/winehq.gpg] http://dl.winehq.org/wine-builds/ubuntu/ {{ release }} main"
  42. state: present
  43. - name: install Wine deb
  44. ansible.builtin.apt:
  45. pkg:
  46. - winehq-stable
  47. ## - winetricks
  48. update_cache: yes
  49. - name: Create prefix dir
  50. become: true
  51. block:
  52. - name: download winetricks
  53. ansible.builtin.get_url:
  54. url: https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
  55. dest: "{{ winetricks_patch }}/winetricks"
  56. mode: '0775'
  57. - name: Create a directory if it does not exist
  58. ansible.builtin.file:
  59. path: "{{ prefix_dir }}"
  60. owner: "{{ user_permission }}"
  61. group: "{{ user_permission }}"
  62. state: directory
  63. - name: Create prefix
  64. block:
  65. - name: Create Office prefix
  66. ansible.builtin.shell: env WINEARCH=win32 WINEPREFIX={{ prefix_path }} wineboot -u
  67. - name: Download font
  68. ansible.builtin.shell: env WINEARCH=win32 WINEPREFIX={{ prefix_path }} {{ winetricks_patch }}/winetricks corefonts allfonts
  69. - name: Download lib
  70. ansible.builtin.shell: env WINEARCH=win32 WINEPREFIX={{ prefix_path }} {{ winetricks_patch }}/winetricks msxml3 msxml4 msxml6 vcrun2015 dotnet40 gdiplus riched30 mfc42 mfc140 vcrun6
  71. register: libinstall
  72. - debug: msg="{{ libinstall }}"
  73. - name: Copy Office files
  74. become: true
  75. block:
  76. - name: Copy Offcie 2013 archive file with owner and permission
  77. ansible.builtin.copy:
  78. src: "{{ officepath }}"
  79. dest: /tmp/2013x32.tar.gz
  80. owner: "{{ user_permission }}"
  81. group: "{{ user_permission }}"
  82. mode: u=rw,g=rw,o=r
  83. - name: Extract Office.tar.gz into /tmp
  84. ansible.builtin.shell: tar xvfz /tmp/2013x32.tar.gz
  85. - name: Install Arduino IDE
  86. become: true
  87. block:
  88. - name: Unarchive a IDE that needs to be downloaded
  89. ansible.builtin.unarchive:
  90. src: https://downloads.arduino.cc/arduino-ide/arduino-ide_2.2.1_Linux_64bit.zip
  91. dest: /tmp/arduinoide
  92. remote_src: yes
  93. - name: Run installer Arduino IDE
  94. ansible.builin.shell: sh /tmp/arduinoide/install.sh
  95. - name: Grant user permission for access ttyACM
  96. ansible.builin.shell: usermod -a -G dialout {{ user_permission }}