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:
authorSviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>2018-10-03 12:27:09 +0300
committerGitHub <noreply@github.com>2018-10-03 12:27:09 +0300
commit59484f4fbfaa8d2c3938661c296ed6c9ae27d956 (patch)
treebf21df6d8b615994302297056cdc8e27825e1c07
parent4aece58be8720bd719e8976137363fa8f30ee163 (diff)
parent32c6b90a0638771927c9fff7f403f92002751b1e (diff)
Merge pull request #237 from jcsmith/cleanup_jboss-standalone
Cleanup jboss standalone examples
-rw-r--r--jboss-standalone/demo-aws-launch.yml6
-rw-r--r--jboss-standalone/deploy-application.yml4
-rw-r--r--jboss-standalone/roles/java-app/tasks/main.yml36
-rw-r--r--jboss-standalone/roles/jboss-standalone/handlers/main.yml8
-rw-r--r--jboss-standalone/roles/jboss-standalone/tasks/main.yml197
5 files changed, 135 insertions, 116 deletions
diff --git a/jboss-standalone/demo-aws-launch.yml b/jboss-standalone/demo-aws-launch.yml
index eb18146..5894465 100644
--- a/jboss-standalone/demo-aws-launch.yml
+++ b/jboss-standalone/demo-aws-launch.yml
@@ -26,8 +26,8 @@
- name: Wait for SSH to come up
wait_for:
host: "{{ item.public_dns_name }}"
- port: 22
- delay: 60
- timeout: 320
+ port: 22
+ delay: 60
+ timeout: 320
state: started
with_items: "{{ ec2.instances }}"
diff --git a/jboss-standalone/deploy-application.yml b/jboss-standalone/deploy-application.yml
index 520532d..fb9876c 100644
--- a/jboss-standalone/deploy-application.yml
+++ b/jboss-standalone/deploy-application.yml
@@ -1,9 +1,9 @@
---
-# This playbook deploys two simple applications to JBoss server.
+# This playbook deploys two simple applications to JBoss server.
- hosts: all
roles:
-# Optionally, (re)deploy JBoss here
+# Optionally, (re)deploy JBoss here.
# - jboss-standalone
- java-app
diff --git a/jboss-standalone/roles/java-app/tasks/main.yml b/jboss-standalone/roles/java-app/tasks/main.yml
index f8416fd..4a92ab2 100644
--- a/jboss-standalone/roles/java-app/tasks/main.yml
+++ b/jboss-standalone/roles/java-app/tasks/main.yml
@@ -1,12 +1,24 @@
----
-- name: Copy application WAR file to host
- copy: src=jboss-helloworld.war dest=/tmp
-
-- name: Deploy HelloWorld to JBoss
- jboss: deploy_path=/usr/share/jboss-as/standalone/deployments/ src=/tmp/jboss-helloworld.war deployment=helloworld.war state=present
-
-- name: Copy application WAR file to host
- copy: src=ticket-monster.war dest=/tmp
-
-- name: Deploy Ticket Monster to JBoss
- jboss: deploy_path=/usr/share/jboss-as/standalone/deployments/ src=/tmp/ticket-monster.war deployment=ticket-monster.war state=present \ No newline at end of file
+---
+- name: Copy application WAR file to host
+ copy:
+ src: jboss-helloworld.war
+ dest: /tmp
+
+- name: Deploy HelloWorld to JBoss
+ jboss:
+ deploy_path: /usr/share/jboss-as/standalone/deployments/
+ src: /tmp/jboss-helloworld.war
+ deployment: helloworld.war
+ state: present
+
+- name: Copy application WAR file to host
+ copy:
+ src: ticket-monster.war
+ dest: /tmp
+
+- name: Deploy Ticket Monster to JBoss
+ jboss:
+ deploy_path: /usr/share/jboss-as/standalone/deployments/
+ src: /tmp/ticket-monster.war
+ deployment: ticket-monster.war
+ state: present
diff --git a/jboss-standalone/roles/jboss-standalone/handlers/main.yml b/jboss-standalone/roles/jboss-standalone/handlers/main.yml
index 047d5f6..cc9b8b5 100644
--- a/jboss-standalone/roles/jboss-standalone/handlers/main.yml
+++ b/jboss-standalone/roles/jboss-standalone/handlers/main.yml
@@ -1,6 +1,10 @@
---
- name: restart jboss
- service: name=jboss state=restarted
+ service:
+ name: jboss
+ state: restarted
- name: restart iptables
- service: name=iptables state=restarted
+ service:
+ name: iptables
+ state: restarted
diff --git a/jboss-standalone/roles/jboss-standalone/tasks/main.yml b/jboss-standalone/roles/jboss-standalone/tasks/main.yml
index d7d76e4..f44ac18 100644
--- a/jboss-standalone/roles/jboss-standalone/tasks/main.yml
+++ b/jboss-standalone/roles/jboss-standalone/tasks/main.yml
@@ -1,97 +1,100 @@
----
-- name: Install Java 1.7 and some basic dependencies
- yum:
- name: "{{ item }}"
- state: present
- with_items:
- - unzip
- - java-1.7.0-openjdk
- - libselinux-python
- - libsemanage-python
-
-- name: Download JBoss from jboss.org
- get_url:
- url: http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final.zip
- dest: /opt/jboss-as-7.1.1.Final.zip
-
-- name: Extract archive
- unarchive:
- dest: /usr/share
- src: /opt/jboss-as-7.1.1.Final.zip
- creates: /usr/share/jboss-as
- copy: no
-
- # Rename the dir to avoid encoding the version in the init script
-- name: Rename install directory
- command: chdir=/usr/share /bin/mv jboss-as-7.1.1.Final jboss-as creates=/usr/share/jboss-as
-
-- name: Copying standalone.xml configuration file
- template:
- src: standalone.xml
- dest: /usr/share/jboss-as/standalone/configuration/
- notify: restart jboss
-
-- name: Add group "jboss"
- group:
- name: jboss
-
-- name: Add user "jboss"
- user:
- name: jboss
- group: jboss
- home: /usr/share/jboss-as
-
-- name: Change ownership of JBoss installation
- file:
- path: /usr/share/jboss-as/
- owner: jboss
- group: jboss
- state: directory
- recurse: yes
-
-- name: Copy the init script
- copy:
- src: jboss-as-standalone.sh
- dest: /etc/init.d/jboss
- mode: 0755
-
-- name: Workaround for systemd bug
- shell: service jboss start && chkconfig jboss on
- ignore_errors: yes
-
-- name: Enable JBoss to be started at boot
- service:
- name: jboss
- enabled: yes
- state: started
-
-- name: deploy iptables rules
- template:
- src: iptables-save
- dest: /etc/sysconfig/iptables
- when: ansible_distribution_major_version != "7"
- notify: restart iptables
-
-- name: Ensure that firewalld is installed
- yum:
- name: firewalld
- state: present
- when: ansible_distribution_major_version == "7"
-
-- name: Ensure that firewalld is started
- service:
- name: firewalld
- state: started
- when: ansible_distribution_major_version == "7"
-
-- name: deploy firewalld rules
- firewalld:
- immediate: yes
- port: "{{ item }}"
- state: enabled
- permanent: yes
- when: ansible_distribution_major_version == "7"
- with_items:
- - "{{ http_port }}/tcp"
- - "{{ https_port }}/tcp"
-
+---
+- name: Install Java 1.7 and some basic dependencies
+ yum:
+ name: "{{ item }}"
+ state: present
+ with_items:
+ - unzip
+ - java-1.7.0-openjdk
+ - libselinux-python
+ - libsemanage-python
+
+- name: Download JBoss from jboss.org
+ get_url:
+ url: http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final.zip
+ dest: /opt/jboss-as-7.1.1.Final.zip
+
+- name: Extract archive
+ unarchive:
+ dest: /usr/share
+ src: /opt/jboss-as-7.1.1.Final.zip
+ creates: /usr/share/jboss-as
+ copy: no
+
+ # Rename the dir to avoid encoding the version in the init script
+- name: Rename install directory
+ command: /bin/mv jboss-as-7.1.1.Final jboss-as
+ args:
+ chdir: /usr/share
+ creates: /usr/share/jboss-as
+
+- name: Copying standalone.xml configuration file
+ template:
+ src: standalone.xml
+ dest: /usr/share/jboss-as/standalone/configuration/
+ notify: restart jboss
+
+- name: Add group "jboss"
+ group:
+ name: jboss
+
+- name: Add user "jboss"
+ user:
+ name: jboss
+ group: jboss
+ home: /usr/share/jboss-as
+
+- name: Change ownership of JBoss installation
+ file:
+ path: /usr/share/jboss-as/
+ owner: jboss
+ group: jboss
+ state: directory
+ recurse: yes
+
+- name: Copy the init script
+ copy:
+ src: jboss-as-standalone.sh
+ dest: /etc/init.d/jboss
+ mode: 0755
+
+- name: Workaround for systemd bug
+ shell: service jboss start && chkconfig jboss on
+ ignore_errors: yes
+
+- name: Enable JBoss to be started at boot
+ service:
+ name: jboss
+ enabled: yes
+ state: started
+
+- name: deploy iptables rules
+ template:
+ src: iptables-save
+ dest: /etc/sysconfig/iptables
+ when: ansible_distribution_major_version != "7"
+ notify: restart iptables
+
+- name: Ensure that firewalld is installed
+ yum:
+ name: firewalld
+ state: present
+ when: ansible_distribution_major_version == "7"
+
+- name: Ensure that firewalld is started
+ service:
+ name: firewalld
+ state: started
+ when: ansible_distribution_major_version == "7"
+
+- name: deploy firewalld rules
+ firewalld:
+ immediate: yes
+ port: "{{ item }}"
+ state: enabled
+ permanent: yes
+ when: ansible_distribution_major_version == "7"
+ with_items:
+ - "{{ http_port }}/tcp"
+ - "{{ https_port }}/tcp"
+