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:
authorDave Johnson <dave@ansible.com>2017-02-14 22:14:13 +0300
committerDave Johnson <dave@ansible.com>2017-02-14 22:14:13 +0300
commit95b72d3664a9fab4289d1def8ecd44def8a476df (patch)
treeb5a72e86ba3121ecd30e546b135a6177b90d6fed
parent18ef5de72d36924e5ac8abf7b0858fa0ec9a6707 (diff)
Updated to YAML best practice syntax
-rw-r--r--jboss-standalone/roles/jboss-standalone/tasks/main.yml60
1 files changed, 47 insertions, 13 deletions
diff --git a/jboss-standalone/roles/jboss-standalone/tasks/main.yml b/jboss-standalone/roles/jboss-standalone/tasks/main.yml
index e6c04b4..3948bdd 100644
--- a/jboss-standalone/roles/jboss-standalone/tasks/main.yml
+++ b/jboss-standalone/roles/jboss-standalone/tasks/main.yml
@@ -1,6 +1,8 @@
---
- 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"