Commit 95b72d36 authored by Dave Johnson's avatar Dave Johnson
Browse files

Updated to YAML best practice syntax

parent 18ef5de7
---
- name: Install Java 1.7 and some basic dependencies
yum: name={{item}} state=present
yum:
name: "{{ item }}"
state: present
with_items:
- unzip
- java-1.7.0-openjdk
......@@ -8,52 +10,84 @@
- 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
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
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/
template:
src: standalone.xml
dest: /usr/share/jboss-as/standalone/configuration/
notify: restart jboss
- name: Add group "jboss"
group: name=jboss
group:
name: jboss
- name: Add user "jboss"
user: name=jboss group=jboss home=/usr/share/jboss-as
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
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
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
- name: Enable JBoss to be started at boot
service: name=jboss enabled=yes state=started
service:
name: jboss
enabled: yes
state: started
- name: deploy iptables rules
template: src=iptables-save dest=/etc/sysconfig/iptables
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
yum:
name: firewalld
state: present
when: ansible_distribution_major_version == "7"
- name: Ensure that firewalld is started
service: name=firewalld state=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
firewalld:
immediate: yes
port: "{{ item }}"
state: enabled
permanent: yes
when: ansible_distribution_major_version == "7"
with_items:
- "{{ http_port }}/tcp"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment