Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ansible/ansible-examples.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Gerla <tim@gerla.net>2013-11-27 07:35:50 +0400
committerTim Gerla <tim@gerla.net>2013-11-27 07:35:50 +0400
commitc769d5e045cb8e5b992c9ad71f9ee2109cb2c897 (patch)
treedaea1ce71177f1c440ef67dbf5015991f22529b3 /lamp_simple
parentb4945a10c324a18cf286973870a14f0750c2903f (diff)
Fix #40 -- test to see if selinux is enabled before running seboolean.
Diffstat (limited to 'lamp_simple')
-rw-r--r--lamp_simple/group_vars/all2
-rw-r--r--lamp_simple/roles/common/tasks/main.yml5
-rw-r--r--lamp_simple/roles/db/tasks/main.yml1
-rw-r--r--lamp_simple/roles/web/tasks/install_httpd.yml1
4 files changed, 8 insertions, 1 deletions
diff --git a/lamp_simple/group_vars/all b/lamp_simple/group_vars/all
index 8b6ffdd..74ca458 100644
--- a/lamp_simple/group_vars/all
+++ b/lamp_simple/group_vars/all
@@ -3,4 +3,4 @@
httpd_port: 80
ntpserver: 192.168.1.2
-repository: http://github.com/bennojoy/mywebapp.git
+repository: https://github.com/bennojoy/mywebapp.git
diff --git a/lamp_simple/roles/common/tasks/main.yml b/lamp_simple/roles/common/tasks/main.yml
index d337b90..cb65f03 100644
--- a/lamp_simple/roles/common/tasks/main.yml
+++ b/lamp_simple/roles/common/tasks/main.yml
@@ -13,3 +13,8 @@
- name: Start the ntp service
service: name=ntpd state=started enabled=true
tags: ntp
+
+- name: test to see if selinux is running
+ command: getenforce
+ register: sestatus
+ changed_when: false
diff --git a/lamp_simple/roles/db/tasks/main.yml b/lamp_simple/roles/db/tasks/main.yml
index 15d8235..3e269c5 100644
--- a/lamp_simple/roles/db/tasks/main.yml
+++ b/lamp_simple/roles/db/tasks/main.yml
@@ -11,6 +11,7 @@
- name: Configure SELinux to start mysql on any port
seboolean: name=mysql_connect_any state=true persistent=yes
+ when: sestatus.rc != 0
- name: Create Mysql configuration file
action: template src=my.cnf.j2 dest=/etc/my.cnf
diff --git a/lamp_simple/roles/web/tasks/install_httpd.yml b/lamp_simple/roles/web/tasks/install_httpd.yml
index 88ca402..7600c91 100644
--- a/lamp_simple/roles/web/tasks/install_httpd.yml
+++ b/lamp_simple/roles/web/tasks/install_httpd.yml
@@ -21,3 +21,4 @@
- name: Configure SELinux to allow httpd to connect to remote database
seboolean: name=httpd_can_network_connect_db state=true persistent=yes
+ when: sestatus.rc != 0