diff --git a/defaults/main.yml b/defaults/main.yml index 6507028..b5ccdd4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,6 @@ --- # https://www.tp-link.com/us/support/download/omada-software-controller/ -omada_tar_src: https://static.tp-link.com/upload/software/2023/202303/20230321/Omada_SDN_Controller_v5.9.31_Linux_x64.tar.gz +omada_tar_src: https://static.tp-link.com/upload/software/2023/202309/20230920/Omada_SDN_Controller_v5.12.7_linux_x64.tar.gz omada_tar_src_remote: true omada_tar_dir: /var/tmp omada_tar_folder: "{{ omada_tar_src | basename | splitext | first | splitext | first }}" diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 19858ae..7a9cb26 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -45,6 +45,6 @@ scenario: - syntax - create - converge - # - idempotence + - idempotence - verify - destroy diff --git a/omada.url b/omada.url index 2c52ee3..09a05fa 100644 --- a/omada.url +++ b/omada.url @@ -1 +1 @@ -https://static.tp-link.com/upload/software/2023/202303/20230321/Omada_SDN_Controller_v5.9.31_Linux_x64.tar.gz +https://static.tp-link.com/upload/software/2023/202309/20230920/Omada_SDN_Controller_v5.12.7_linux_x64.tar.gz diff --git a/tasks/main.yml b/tasks/main.yml index 209bc01..fdec18a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -35,10 +35,9 @@ tags: jsvc - name: Check for jsvc binary - ansible.builtin.command: which jsvc - ignore_errors: true + ansible.builtin.stat: + path: /usr/bin/jsvc register: jsvc_binary - changed_when: jsvc_binary.rc tags: jsvc - name: Error when jsvc is missing @@ -46,21 +45,20 @@ msg: 'Error: jsvc is not present, Omada SDN requires jsvc' when: - "'jsvc' not in ansible_facts.packages" - - jsvc_binary.rc != 0 + - not jsvc_binary.stat.exists tags: jsvc - name: Check for omada binary - ansible.builtin.command: which tpeap - ignore_errors: true + ansible.builtin.stat: + path: /usr/bin/tpeap register: omada_binary - changed_when: omada_binary.rc - name: Create a temporary directory for omada tar file ansible.builtin.file: path: '{{ omada_tar_dir }}/{{ omada_tar_folder }}' state: directory mode: '0775' - when: omada_binary.rc != 0 + when: not omada_binary.stat.exists register: omada_temp_dir - name: Download and extract omada software @@ -71,7 +69,7 @@ extra_opts: - --strip-components=1 register: omada_tar - when: omada_binary.rc != 0 + when: not omada_binary.stat.exists - name: Run omada install script become: true