This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/master by this push:
     new 2820cbd798 Ansible: fixes for Django portal deploy on Ubuntu 18
2820cbd798 is described below

commit 2820cbd798d99c385a6be020eb1f7035e066170e
Author: Marcus Christie <[email protected]>
AuthorDate: Wed Sep 14 16:51:44 2022 -0400

    Ansible: fixes for Django portal deploy on Ubuntu 18
---
 dev-tools/ansible/roles/django/tasks/database.yml | 3 ++-
 dev-tools/ansible/roles/django/tasks/main.yml     | 2 +-
 dev-tools/ansible/roles/tusd/tasks/main.yml       | 6 ++++++
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/dev-tools/ansible/roles/django/tasks/database.yml 
b/dev-tools/ansible/roles/django/tasks/database.yml
index 4b69a1b233..a4e963f860 100644
--- a/dev-tools/ansible/roles/django/tasks/database.yml
+++ b/dev-tools/ansible/roles/django/tasks/database.yml
@@ -21,8 +21,9 @@
 ---
 
 - name: Adds Python MySQL support on Debian/Ubuntu
-  apt: pkg="python-mysqldb" state=present
+  apt: pkg="python3-mysqldb" state=present
   become: true
+  become_user: root
   when: hostvars[delegated_host].ansible_os_family == 'Debian'
 
 # Explicitly lookup hostvars for delegated host. There seem to be bugs around
diff --git a/dev-tools/ansible/roles/django/tasks/main.yml 
b/dev-tools/ansible/roles/django/tasks/main.yml
index bbe1f10fed..892a3947c7 100644
--- a/dev-tools/ansible/roles/django/tasks/main.yml
+++ b/dev-tools/ansible/roles/django/tasks/main.yml
@@ -25,7 +25,7 @@
   delegate_to: "{{item}}"
   delegate_facts: True
   with_items:
-  - "{{ groups['database'] }}"
+  - "{{ django_database_hosts }}"
 
 # Use 'apply' to propagate delegate_to and become* to included tasks, see
 # https://github.com/ansible/ansible/issues/35398
diff --git a/dev-tools/ansible/roles/tusd/tasks/main.yml 
b/dev-tools/ansible/roles/tusd/tasks/main.yml
index af7807abe0..7655525e86 100644
--- a/dev-tools/ansible/roles/tusd/tasks/main.yml
+++ b/dev-tools/ansible/roles/tusd/tasks/main.yml
@@ -93,21 +93,26 @@
 
 - name: Copy SELinux type enforcement file
   copy: src=my-tusd.te dest=/tmp/
+  when: ansible_os_family == "RedHat"
 
 - name: Compile SELinux module file
   command: checkmodule -M -m -o /tmp/my-tusd.mod /tmp/my-tusd.te
+  when: ansible_os_family == "RedHat"
 
 - name: Build SELinux policy package
   command: semodule_package -o /tmp/my-tusd.pp -m /tmp/my-tusd.mod
+  when: ansible_os_family == "RedHat"
 
 - name: unLoad SELinux policy package
   command: semodule -r my-tusd
   become: yes
   ignore_errors: True
+  when: ansible_os_family == "RedHat"
 
 - name: Load SELinux policy package
   command: semodule -i /tmp/my-tusd.pp
   become: yes
+  when: ansible_os_family == "RedHat"
 
 - name: Remove temporary files
   file: path={{ item }} state=absent
@@ -115,6 +120,7 @@
     - /tmp/my-tusd.mod
     - /tmp/my-tusd.pp
     - /tmp/my-tusd.te
+  when: ansible_os_family == "RedHat"
 
 - name: copy tus.service systemd unit file
   template:

Reply via email to