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

main.yml « tasks « jboss-standalone « roles « jboss-standalone - github.com/ansible/ansible-examples.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d7d76e44609872d545c55963b5ede1b7d68c01c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
---
- 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"