diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index f1dcb5a..61de970 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -6,8 +6,9 @@ ansible.builtin.include_role: name: ea31337.metatrader vars: + # @fixme: https://github.com/Winetricks/winetricks/issues/2119 # noqa: var-naming[no-role-prefix] wine_winetricks_url: >- - https://raw.githubusercontent.com/jre-wine/winetricks/Workaround_missing_/usr/bin/wine64/src/winetricks + https://raw.githubusercontent.com/kenorb-contrib/winetricks/GH-2119-fix/src/winetricks # noqa: var-naming[no-role-prefix] wine_winetricks_winver: win10 diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml index ac24b31..6baad76 100644 --- a/molecule/default/verify.yml +++ b/molecule/default/verify.yml @@ -8,7 +8,7 @@ path: /root/.wine/drive_c/Program Files/MetaTrader 5 register: stat_result - - name: Verify platform exist + - name: Verify platform directory exist ansible.builtin.assert: that: - stat_result.stat.exists @@ -24,12 +24,12 @@ register: find_mt_res when: ansible_os_family != "Windows" - - name: Check if Meta Editor exists + - name: Checks if platform's editor exists changed_when: false - failed_when: find_mt_res.matched == 0 + failed_when: find_mte_res.matched == 0 ansible.builtin.find: paths: '{{ ansible_env.HOME }}/.wine/drive_c' - patterns: metaeditor*.exe + patterns: "[mM]eta[eE]ditor*.exe" recurse: true register: find_mte_res when: ansible_os_family != "Windows" diff --git a/molecule/mt4/converge.yml b/molecule/mt4/converge.yml index 8adc520..b1b770d 100644 --- a/molecule/mt4/converge.yml +++ b/molecule/mt4/converge.yml @@ -9,8 +9,9 @@ metatrader_setup_url: | https://download.mql5.com/cdn/web/3315/mt4/xm4setup.exe metatrader_version: 4 + # @fixme: https://github.com/Winetricks/winetricks/issues/2119 # noqa: var-naming[no-role-prefix] wine_winetricks_url: >- - https://raw.githubusercontent.com/jre-wine/winetricks/Workaround_missing_/usr/bin/wine64/src/winetricks + https://raw.githubusercontent.com/kenorb-contrib/winetricks/GH-2119-fix/src/winetricks # noqa: var-naming[no-role-prefix] wine_winetricks_winver: win10 diff --git a/molecule/mt4/verify.yml b/molecule/mt4/verify.yml index a375c13..48f752d 100644 --- a/molecule/mt4/verify.yml +++ b/molecule/mt4/verify.yml @@ -8,7 +8,7 @@ path: /root/.wine/drive_c/Program Files register: stat_result - - name: Verify Program Files exist + - name: Verify Program Files directory exist ansible.builtin.assert: that: - stat_result.stat.exists @@ -24,12 +24,12 @@ register: find_mt_res when: ansible_os_family != "Windows" - - name: Check if Meta Editor exists + - name: Checks if platform's editor exists changed_when: false - failed_when: find_mt_res.matched == 0 + failed_when: find_mte_res.matched == 0 ansible.builtin.find: paths: '{{ ansible_env.HOME }}/.wine/drive_c' - patterns: metaeditor*.exe + patterns: "[mM]eta[eE]ditor*.exe" recurse: true register: find_mte_res when: ansible_os_family != "Windows" diff --git a/molecule/mt5/converge.yml b/molecule/mt5/converge.yml index a6c2b68..eb8f079 100644 --- a/molecule/mt5/converge.yml +++ b/molecule/mt5/converge.yml @@ -7,8 +7,9 @@ name: ea31337.metatrader vars: metatrader_version: 5 + # @fixme: https://github.com/Winetricks/winetricks/issues/2119 # noqa: var-naming[no-role-prefix] wine_winetricks_url: >- - https://raw.githubusercontent.com/jre-wine/winetricks/Workaround_missing_/usr/bin/wine64/src/winetricks + https://raw.githubusercontent.com/kenorb-contrib/winetricks/GH-2119-fix/src/winetricks # noqa: var-naming[no-role-prefix] wine_winetricks_winver: win10 diff --git a/molecule/mt5/verify.yml b/molecule/mt5/verify.yml index ac24b31..6baad76 100644 --- a/molecule/mt5/verify.yml +++ b/molecule/mt5/verify.yml @@ -8,7 +8,7 @@ path: /root/.wine/drive_c/Program Files/MetaTrader 5 register: stat_result - - name: Verify platform exist + - name: Verify platform directory exist ansible.builtin.assert: that: - stat_result.stat.exists @@ -24,12 +24,12 @@ register: find_mt_res when: ansible_os_family != "Windows" - - name: Check if Meta Editor exists + - name: Checks if platform's editor exists changed_when: false - failed_when: find_mt_res.matched == 0 + failed_when: find_mte_res.matched == 0 ansible.builtin.find: paths: '{{ ansible_env.HOME }}/.wine/drive_c' - patterns: metaeditor*.exe + patterns: "[mM]eta[eE]ditor*.exe" recurse: true register: find_mte_res when: ansible_os_family != "Windows" diff --git a/tasks/main.yml b/tasks/main.yml index 0540942..d054651 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -43,3 +43,5 @@ state: absent - name: Verifies ansible.builtin.include_tasks: verify.yml + tags: + - metatrader_verify diff --git a/tasks/verify.yml b/tasks/verify.yml index d245149..58bf970 100644 --- a/tasks/verify.yml +++ b/tasks/verify.yml @@ -1,19 +1,24 @@ --- -- name: Checks if Meta Terminal exists - changed_when: false - failed_when: find_mt_res.matched == 0 - ansible.builtin.find: - paths: '{{ ansible_env.HOME }}/.wine/drive_c' - patterns: terminal*.exe - recurse: true - register: find_mt_res - when: ansible_os_family != "Windows" -- name: Checks if Meta Editor exists - changed_when: false - failed_when: find_mt_res.matched == 0 - ansible.builtin.find: - paths: '{{ ansible_env.HOME }}/.wine/drive_c' - patterns: metaeditor*.exe - recurse: true - register: find_mte_res - when: ansible_os_family != "Windows" +- name: Verifies platform files exist + tags: + - metatrader_verify + block: + - name: Checks if platform's terminal exists + changed_when: false + failed_when: find_mt_res.matched == 0 + ansible.builtin.find: + paths: '{{ ansible_env.HOME }}/.wine/drive_c' + patterns: terminal*.exe + recurse: true + register: find_mt_res + when: ansible_os_family != "Windows" + + - name: Checks if platform's editor exists + changed_when: false + failed_when: find_mte_res.matched == 0 + ansible.builtin.find: + paths: '{{ ansible_env.HOME }}/.wine/drive_c' + patterns: "[mM]eta[eE]ditor*.exe" + recurse: true + register: find_mte_res + when: ansible_os_family != "Windows" diff --git a/templates/mt5_install.verb.j2 b/templates/mt5_install.verb.j2 index 4e1a948..68be3b1 100644 --- a/templates/mt5_install.verb.j2 +++ b/templates/mt5_install.verb.j2 @@ -23,8 +23,7 @@ load_mt5_install() SetTitleMatchMode, RegEx WinWait, MetaTrader 5,, 30 Send, {Enter} - WinWait, MetaTrader 5 Setup, Congratulations! - Send, {Tab}{Enter} + WinWaitClose Process, Wait, terminal64.exe, 30 Process, Close, terminal64.exe "