Skip to content

Commit

Permalink
Merge pull request #1039 from roots/fix-ubuntu-bionic-python-interpreter
Browse files Browse the repository at this point in the history
Fix Ubuntu 18.04 python interpreter
  • Loading branch information
swalkinshaw authored Dec 13, 2018
2 parents ac4b511 + ff496ae commit 6317bd4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
7 changes: 7 additions & 0 deletions dev.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
---
- name: Set ansible_python_interpreter
hosts: web:&development
gather_facts: false
become: yes
roles:
- { role: python_interpreter, tags: [always] }

- name: "WordPress Server: Install LEMP Stack with PHP 7.2 and MariaDB MySQL"
hosts: web:&development
become: yes
Expand Down
11 changes: 11 additions & 0 deletions roles/python_interpreter/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
- block:
- name: Get Ubuntu release
raw: lsb_release -cs
register: ubuntu_release
changed_when: false
- name: Set ansible_python_interpreter for Ubuntu 18.04 Bionic
set_fact:
ansible_python_interpreter: python3
when: ubuntu_release.stdout | trim == 'bionic'
when: ansible_python_interpreter is not defined
tags: always
14 changes: 2 additions & 12 deletions server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,8 @@
hosts: web:&{{ env }}
gather_facts: false
become: yes
tasks:
- block:
- name: Get Ubuntu release
raw: lsb_release -cs
register: ubuntu_release
changed_when: false
- name: Set ansible_python_interpreter for Ubuntu 18.04 Bionic
set_fact:
ansible_python_interpreter: python3
when: ubuntu_release.stdout_lines[0] == 'bionic'
when: ansible_python_interpreter is not defined
tags: always
roles:
- { role: python_interpreter, tags: [always] }

- name: WordPress Server - Install LEMP Stack with PHP 7.2 and MariaDB MySQL
hosts: web:&{{ env }}
Expand Down

0 comments on commit 6317bd4

Please sign in to comment.