--- - hosts: userps vars: release: focal winetricks_patch: /usr/bin prefix_dir: /usr/prefixes prefix_path: /usr/prefixes/msapps1 user_permission: oktadmin prefix_user_permission: student officepath: /home/vidikon/ANSIBLE/Office2013.tar.gz skipstep: false #become: true gather_facts: no tasks: - name: upgrade system block: #- name: dpkg --configure -a # become: true # ansible.builtin.shell: dpkg --remove --force-remove-reinstreq packettracer - name: Upgrade all packets become: true ansible.builtin.apt: name: "*" state: latest when: skipstep == "true" - name: wine (add architecture) become: true shell: cmd: dpkg --add-architecture i386 when: skipstep == "true" - name: install software-properties-common deb become: true ansible.builtin.apt: pkg: - software-properties-common - dirmngr - ca-certificates - apt-transport-https - curl when: skipstep == "true" - name: One way to avoid apt_key once it is removed from your distro become: true block: - name: add key 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 - name: add repo ansible.builtin.apt_repository: repo: "deb [signed-by=/usr/share/keyrings/winehq.gpg] http://dl.winehq.org/wine-builds/ubuntu/ {{ release }} main" state: present - name: install Wine deb ansible.builtin.apt: pkg: - winehq-stable # - winetricks update_cache: yes - name: Copy winetrics file with owner and permission ansible.builtin.copy: src: "./scripts/winetricks" owner: "{{ user_permission }}" group: "{{ user_permission }}" dest: /usr/bin/winetricks mode: u=rwx,g=rwx,o=wrx when: skipstep == "true" - name: Create prefix dir become: true block: - name: Create a directory if it does not exist ansible.builtin.file: path: "{{ prefix_dir }}" owner: "{{ user_permission }}" group: "{{ user_permission }}" state: directory #when: skipstep == "true" - name: Create prefix and install lib block: - name: Create Office prefix ansible.builtin.shell: WINEARCH=win32 WINEPREFIX={{ prefix_path }} wineboot -u # - name: Download font # ansible.builtin.shell: WINEARCH=win32 WINEPREFIX={{ prefix_path }} {{ winetricks_patch }}/winetricks corefonts allfonts # register: fontinstall # - debug: msg="{{ fontinstall }}" - name: Download lib ansible.builtin.shell: WINEARCH=win32 WINEPREFIX={{ prefix_path }} {{ winetricks_patch }}/winetricks msxml3 msxml4 msxml6 vcrun2015 dotnet40 gdiplus riched30 mfc42 mfc140 vcrun6 register: libinstall - debug: msg="{{ libinstall }}" environment: HTTP_PROXY: http://78.47.186.43:6666 #HTTPS_PROXY: