-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-rlks.yml
96 lines (84 loc) · 3.31 KB
/
setup-rlks.yml
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
---
- hosts: rlks_server
name: Installs IBM Rational License Key Server, imports license file and starts as a service
# gather_facts: yes
become: yes
tasks:
# redhat-lsb for RHEL/CENTOS, lsb for SUSE, lsb-core for Ubuntu
- name: set os specific variable of packagename
include_vars:
file: "{{ item }}"
with_first_found:
- 'vars/{{ ansible_distribution }}.yml'
- 'vars/{{ ansible_os_family }}.yml'
- name: verify that prereqs are installed
package:
name: "{{ required_packages }}"
state: present
- name: create a download directory if not exists
become: yes
file:
path: "{{ download_dir }}"
state: directory
recurse: yes
- name: download rlks installation pack
become: yes
copy:
src: "{{ rlks_installfiles_location }}/{{ rlks_file_name }}.{{ rlks_file_extension }}"
dest: "{{ download_dir }}"
- name: unzip rlks installation pack
unarchive:
src: "{{ download_dir }}/{{ rlks_file_name }}.{{ rlks_file_extension }}"
dest: "{{ download_dir }}"
creates: "{{ download_dir }}/{{ rlks_source_dir }}"
remote_src: yes
- name: update rlks installation properties in the responsefile
template:
src: "{{ rlks_responsefile_name }}.j2"
dest: "{{ download_dir }}/{{ rlks_source_dir }}/{{ rlks_responsefile_name }}"
vars:
repository_location: "{{ download_dir }}/{{ rlks_source_dir }}/{{ rlks_source_diskdir }}"
installation_location: "{{ rlks_target_directory }}"
shared_location: "{{ im_shared_directory }}"
install_version: "{{ rlks_install_version }}"
- name: install RLKS silently
become: yes
shell: ./imcl input "{{ download_dir }}/{{ rlks_source_dir }}/{{ rlks_responsefile_name }}" -log "{{ download_dir }}/{{ rlks_source_dir }}/{{ rlks_install_log_name }}" -acceptLicense
args:
chdir: "{{ download_dir }}/{{ rlks_source_dir }}/{{ rlks_source_diskdir }}/{{ rlks_source_instimage_dir }}/{{ rlks_source_instimage_tools_dir }}"
creates: "{{ download_dir }}/{{ rlks_source_dir }}/{{ rlks_install_log_name }}"
- name: import license file
become: yes
copy:
src: "{{ rlks_installfiles_location }}/{{ rlks_source_license_file_name }}"
dest: "{{ rlks_target_directory }}/{{ rlks_target_license_directory }}/{{ rlks_target_license_file_name }}"
backup: yes
force: yes
- name: update rlks service properties
become: yes
template:
src: "{{ rlks_service_file }}.j2"
dest: "/etc/systemd/system/{{ rlks_service_file }}"
vars:
installation_location: "{{ rlks_target_directory }}"
license_location: "{{ rlks_target_license_directory }}"
license_file: "{{ rlks_target_license_file_name }}"
service_user: "{{ rlks_service_user }}"
service_group: "{{ rlks_service_group }}"
- name: Grant read and execute permissions to service
become: yes
file:
path: "/etc/systemd/system/{{ rlks_service_file }}"
mode: '0755'
- name: Change ownership of RLKS installation direcotry
become: yes
file:
path: "{{ rlks_target_directory }}"
owner: "{{ rlks_service_user }}"
group: "{{ rlks_service_user }}"
- name: start rlks service
become: yes
service:
name: "{{ rlks_service_name }}"
enabled: yes
state: started