Skip to content

Commit 59484f4

Browse files
authored
Merge pull request ansible#237 from jcsmith/cleanup_jboss-standalone
Cleanup jboss standalone examples
2 parents 4aece58 + 32c6b90 commit 59484f4

File tree

5 files changed

+135
-116
lines changed

5 files changed

+135
-116
lines changed

jboss-standalone/demo-aws-launch.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
- name: Wait for SSH to come up
2727
wait_for:
2828
host: "{{ item.public_dns_name }}"
29-
port: 22
30-
delay: 60
31-
timeout: 320
29+
port: 22
30+
delay: 60
31+
timeout: 320
3232
state: started
3333
with_items: "{{ ec2.instances }}"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
# This playbook deploys two simple applications to JBoss server.
2+
# This playbook deploys two simple applications to JBoss server.
33

44
- hosts: all
55

66
roles:
7-
# Optionally, (re)deploy JBoss here
7+
# Optionally, (re)deploy JBoss here.
88
# - jboss-standalone
99
- java-app
Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
1-
---
2-
- name: Copy application WAR file to host
3-
copy: src=jboss-helloworld.war dest=/tmp
4-
5-
- name: Deploy HelloWorld to JBoss
6-
jboss: deploy_path=/usr/share/jboss-as/standalone/deployments/ src=/https/github.com/tmp/jboss-helloworld.war deployment=helloworld.war state=present
7-
8-
- name: Copy application WAR file to host
9-
copy: src=ticket-monster.war dest=/tmp
10-
11-
- name: Deploy Ticket Monster to JBoss
12-
jboss: deploy_path=/usr/share/jboss-as/standalone/deployments/ src=/https/github.com/tmp/ticket-monster.war deployment=ticket-monster.war state=present
1+
---
2+
- name: Copy application WAR file to host
3+
copy:
4+
src: jboss-helloworld.war
5+
dest: /tmp
6+
7+
- name: Deploy HelloWorld to JBoss
8+
jboss:
9+
deploy_path: /usr/share/jboss-as/standalone/deployments/
10+
src: /tmp/jboss-helloworld.war
11+
deployment: helloworld.war
12+
state: present
13+
14+
- name: Copy application WAR file to host
15+
copy:
16+
src: ticket-monster.war
17+
dest: /tmp
18+
19+
- name: Deploy Ticket Monster to JBoss
20+
jboss:
21+
deploy_path: /usr/share/jboss-as/standalone/deployments/
22+
src: /tmp/ticket-monster.war
23+
deployment: ticket-monster.war
24+
state: present
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
---
22
- name: restart jboss
3-
service: name=jboss state=restarted
3+
service:
4+
name: jboss
5+
state: restarted
46

57
- name: restart iptables
6-
service: name=iptables state=restarted
8+
service:
9+
name: iptables
10+
state: restarted
Lines changed: 100 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,100 @@
1-
---
2-
- name: Install Java 1.7 and some basic dependencies
3-
yum:
4-
name: "{{ item }}"
5-
state: present
6-
with_items:
7-
- unzip
8-
- java-1.7.0-openjdk
9-
- libselinux-python
10-
- libsemanage-python
11-
12-
- name: Download JBoss from jboss.org
13-
get_url:
14-
url: http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final.zip
15-
dest: /opt/jboss-as-7.1.1.Final.zip
16-
17-
- name: Extract archive
18-
unarchive:
19-
dest: /usr/share
20-
src: /opt/jboss-as-7.1.1.Final.zip
21-
creates: /usr/share/jboss-as
22-
copy: no
23-
24-
# Rename the dir to avoid encoding the version in the init script
25-
- name: Rename install directory
26-
command: chdir=/usr/share /bin/mv jboss-as-7.1.1.Final jboss-as creates=/usr/share/jboss-as
27-
28-
- name: Copying standalone.xml configuration file
29-
template:
30-
src: standalone.xml
31-
dest: /usr/share/jboss-as/standalone/configuration/
32-
notify: restart jboss
33-
34-
- name: Add group "jboss"
35-
group:
36-
name: jboss
37-
38-
- name: Add user "jboss"
39-
user:
40-
name: jboss
41-
group: jboss
42-
home: /usr/share/jboss-as
43-
44-
- name: Change ownership of JBoss installation
45-
file:
46-
path: /usr/share/jboss-as/
47-
owner: jboss
48-
group: jboss
49-
state: directory
50-
recurse: yes
51-
52-
- name: Copy the init script
53-
copy:
54-
src: jboss-as-standalone.sh
55-
dest: /etc/init.d/jboss
56-
mode: 0755
57-
58-
- name: Workaround for systemd bug
59-
shell: service jboss start && chkconfig jboss on
60-
ignore_errors: yes
61-
62-
- name: Enable JBoss to be started at boot
63-
service:
64-
name: jboss
65-
enabled: yes
66-
state: started
67-
68-
- name: deploy iptables rules
69-
template:
70-
src: iptables-save
71-
dest: /etc/sysconfig/iptables
72-
when: ansible_distribution_major_version != "7"
73-
notify: restart iptables
74-
75-
- name: Ensure that firewalld is installed
76-
yum:
77-
name: firewalld
78-
state: present
79-
when: ansible_distribution_major_version == "7"
80-
81-
- name: Ensure that firewalld is started
82-
service:
83-
name: firewalld
84-
state: started
85-
when: ansible_distribution_major_version == "7"
86-
87-
- name: deploy firewalld rules
88-
firewalld:
89-
immediate: yes
90-
port: "{{ item }}"
91-
state: enabled
92-
permanent: yes
93-
when: ansible_distribution_major_version == "7"
94-
with_items:
95-
- "{{ http_port }}/tcp"
96-
- "{{ https_port }}/tcp"
97-
1+
---
2+
- name: Install Java 1.7 and some basic dependencies
3+
yum:
4+
name: "{{ item }}"
5+
state: present
6+
with_items:
7+
- unzip
8+
- java-1.7.0-openjdk
9+
- libselinux-python
10+
- libsemanage-python
11+
12+
- name: Download JBoss from jboss.org
13+
get_url:
14+
url: http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final.zip
15+
dest: /opt/jboss-as-7.1.1.Final.zip
16+
17+
- name: Extract archive
18+
unarchive:
19+
dest: /usr/share
20+
src: /opt/jboss-as-7.1.1.Final.zip
21+
creates: /usr/share/jboss-as
22+
copy: no
23+
24+
# Rename the dir to avoid encoding the version in the init script
25+
- name: Rename install directory
26+
command: /bin/mv jboss-as-7.1.1.Final jboss-as
27+
args:
28+
chdir: /usr/share
29+
creates: /usr/share/jboss-as
30+
31+
- name: Copying standalone.xml configuration file
32+
template:
33+
src: standalone.xml
34+
dest: /usr/share/jboss-as/standalone/configuration/
35+
notify: restart jboss
36+
37+
- name: Add group "jboss"
38+
group:
39+
name: jboss
40+
41+
- name: Add user "jboss"
42+
user:
43+
name: jboss
44+
group: jboss
45+
home: /usr/share/jboss-as
46+
47+
- name: Change ownership of JBoss installation
48+
file:
49+
path: /usr/share/jboss-as/
50+
owner: jboss
51+
group: jboss
52+
state: directory
53+
recurse: yes
54+
55+
- name: Copy the init script
56+
copy:
57+
src: jboss-as-standalone.sh
58+
dest: /etc/init.d/jboss
59+
mode: 0755
60+
61+
- name: Workaround for systemd bug
62+
shell: service jboss start && chkconfig jboss on
63+
ignore_errors: yes
64+
65+
- name: Enable JBoss to be started at boot
66+
service:
67+
name: jboss
68+
enabled: yes
69+
state: started
70+
71+
- name: deploy iptables rules
72+
template:
73+
src: iptables-save
74+
dest: /etc/sysconfig/iptables
75+
when: ansible_distribution_major_version != "7"
76+
notify: restart iptables
77+
78+
- name: Ensure that firewalld is installed
79+
yum:
80+
name: firewalld
81+
state: present
82+
when: ansible_distribution_major_version == "7"
83+
84+
- name: Ensure that firewalld is started
85+
service:
86+
name: firewalld
87+
state: started
88+
when: ansible_distribution_major_version == "7"
89+
90+
- name: deploy firewalld rules
91+
firewalld:
92+
immediate: yes
93+
port: "{{ item }}"
94+
state: enabled
95+
permanent: yes
96+
when: ansible_distribution_major_version == "7"
97+
with_items:
98+
- "{{ http_port }}/tcp"
99+
- "{{ https_port }}/tcp"
100+

0 commit comments

Comments
 (0)