diff --git a/deno/playbook.yaml b/deno/playbook.yaml index a62ba1d..6d3868b 100644 --- a/deno/playbook.yaml +++ b/deno/playbook.yaml @@ -61,6 +61,15 @@ name: sourcemap executable: pip3 state: present + when: ansible_facts['distribution_major_version'] | int < 22 + + - name: Install pyodbc + apt: + pkg: + - python3-pyodbc + state: present + update_cache: true + when: ansible_facts['distribution_major_version'] | int >= 22 - name: Install requests become: true @@ -68,3 +77,12 @@ name: requests executable: pip3 state: present + when: ansible_facts['distribution_major_version'] | int < 22 + + - name: Install requests + apt: + pkg: + - python3-requests + state: present + update_cache: true + when: ansible_facts['distribution_major_version'] | int >= 22 diff --git a/helper_mssql/playbook.yaml b/helper_mssql/playbook.yaml index ee9a90e..68adc42 100644 --- a/helper_mssql/playbook.yaml +++ b/helper_mssql/playbook.yaml @@ -29,6 +29,15 @@ become_user: codio pip: name: pyodbc + when: ansible_facts['distribution_major_version'] | int < 22 + + - name: Install pyodbc + apt: + pkg: + - python3-pyodbc + state: present + update_cache: true + when: ansible_facts['distribution_major_version'] | int >= 22 - name: Creates directory become_user: codio diff --git a/helper_mysql/playbook.yaml b/helper_mysql/playbook.yaml index 30a59f1..0866c4d 100644 --- a/helper_mysql/playbook.yaml +++ b/helper_mysql/playbook.yaml @@ -25,7 +25,16 @@ - name: Install mysql-connector-python become_user: codio pip: - name: mysql-connector-python==8.2.0 + name: mysql-connector-python==26.7.0 + when: ansible_facts['distribution_major_version'] | int < 22 + + - name: Install mysql-connector-python + apt: + pkg: + - python3-mysql.connector + state: present + update_cache: true + when: ansible_facts['distribution_major_version'] | int >= 22 - name: Creates directory become_user: codio diff --git a/helper_postgres/playbook.yaml b/helper_postgres/playbook.yaml index e5f3702..87dd673 100644 --- a/helper_postgres/playbook.yaml +++ b/helper_postgres/playbook.yaml @@ -33,6 +33,15 @@ become_user: codio pip: name: psycopg2 + when: ansible_facts['distribution_major_version'] | int < 22 + + - name: Install psycopg2 + apt: + pkg: + - python3-psycopg2 + state: present + update_cache: true + when: ansible_facts['distribution_major_version'] | int >= 22 - name: Creates directory become_user: codio diff --git a/python-lsp/playbook.yaml b/python-lsp/playbook.yaml index cdaf75d..2b6c181 100644 --- a/python-lsp/playbook.yaml +++ b/python-lsp/playbook.yaml @@ -26,8 +26,19 @@ update_cache: true when: ansible_facts['distribution_major_version'] | int >= 22 - name: install python-language-server for ubuntu >= 22 - pip: name=python-language-server version=0.36.2 + apt: + name: python3-pylsp + state: present + update_cache: true when: ansible_facts['distribution_major_version'] | int >= 22 - name: install pycodestyle pip: name=pycodestyle + when: ansible_facts['distribution_major_version'] | int < 22 + + - name: install pycodestyle for ubuntu >= 22 + apt: + name: pycodestyle + state: present + update_cache: true + when: ansible_facts['distribution_major_version'] | int >= 22 diff --git a/python2/playbook.yaml b/python2/playbook.yaml index 1dd1994..9341af8 100644 --- a/python2/playbook.yaml +++ b/python2/playbook.yaml @@ -3,6 +3,11 @@ become: yes become_user: root tasks: + - name: Fail if running on Ubuntu > 22.04 + fail: + msg: "These tasks should only be run on Ubuntu 22.04 or earlier" + when: ansible_distribution != "Ubuntu" or ansible_distribution_version is version('22.04', '>') + - apt: name=python state=present - apt: name=python-dev state=present - apt: name=python-pip state=present diff --git a/r-studio/playbook.yaml b/r-studio/playbook.yaml index e197efa..6bf3eef 100644 --- a/r-studio/playbook.yaml +++ b/r-studio/playbook.yaml @@ -3,10 +3,10 @@ become: yes become_user: root tasks: - - name: Fail if not running on Ubuntu 22.04 + - name: Fail if running on Ubuntu < 22.04 fail: - msg: "These tasks should only be run on Ubuntu 22.04" - when: ansible_distribution != "Ubuntu" or ansible_distribution_version != "22.04" + msg: "These tasks should only be run on Ubuntu 22.04 or later" + when: ansible_distribution != "Ubuntu" or ansible_distribution_version is version('22.04', '<') - name: Install essential packages ansible.builtin.apt: