opera.yml 2.92 KB
Newer Older
julian.gethmann's avatar
julian.gethmann committed
1
2
---
- name: check if Opera is installed
julian.gethmann's avatar
julian.gethmann committed
3
  stat:
julian.gethmann's avatar
julian.gethmann committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
    path: "{{ opera_path }}/code/bin/opera_manager"
  register: stat_result

- name: copy Opera files to local machine
  become: yes
  become_user: gethmann  # Hack since root is not allowed to view /mnt/las-archiv1
  copy:
    src: /mnt/las-archiv1/system/Opera/18/Opera_RHEL7.tar.bz
    dest: /tmp
    remote_src: True
  when: stat_result.stat.exists == False

- name: unzip Opera
  become: yes
julian.gethmann's avatar
julian.gethmann committed
18
  unarchive:
julian.gethmann's avatar
julian.gethmann committed
19
20
21
22
23
24
25
    src: /tmp/Opera_RHEL7.tar.bz
    dest: /usr/local/share/
    creates: "{{ opera_path }}/code/bin/opera_manager"
    remote_src: yes

- name: install dependencies
  become: yes
julian.gethmann's avatar
julian.gethmann committed
26
  dnf:
julian.gethmann's avatar
julian.gethmann committed
27
28
29
30
31
32
33
34
35
36
37
    name: "{{ item }}"
    state: present
  when: (ansible_distribution == "Fedora" and ansible_distribution_major_version >= "24")
  with_items:
    - 'libpng15'
    - 'xcb-util-image'
    - 'xcb-util-wm'
    - 'xcb-util-keysyms'
    - 'xcb-util-renderutil'
    - 'xterm'

julian.gethmann's avatar
julian.gethmann committed
38
# Work around for Fedora 25 vs. CentOS 7
julian.gethmann's avatar
julian.gethmann committed
39
40
- name: create dir for CentOS 7 libs
  become: yes
julian.gethmann's avatar
julian.gethmann committed
41
  file:
julian.gethmann's avatar
julian.gethmann committed
42
43
44
45
46
47
    name: "{{ opera_path }}/CentOS7libs"
    state: directory
  when: (ansible_distribution == "Fedora" and ansible_distribution_major_version >= "22")

- name: copy libraries from real CentOS 7 host (server)
  become: yes
48
  become_user: gethmann  # see above
julian.gethmann's avatar
julian.gethmann committed
49
  copy:
julian.gethmann's avatar
julian.gethmann committed
50
51
    src: "/mnt/las-archiv1/system/Opera/18/CentOS7libs/{{ item.src }}"
    dest: "{{ opera_path }}/CentOS7libs/{{ item.dest }}"
52
    remote_src: True
julian.gethmann's avatar
julian.gethmann committed
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
  with_items:
    - { dest: 'libicui18n.so.50', src: 'libicui18n.so.50.1.2' }
    - { dest: 'libicuuc.so.50', src: 'libicuuc.so.50.1.2' }
    - { dest: 'libicudata.so.50', src: 'libicudata.so.50.1.2' }
  when: (ansible_distribution == "Fedora" and ansible_distribution_major_version >= "22")

- name: make CentOS7 libs available
  become: yes
  copy:
    dest: /etc/ld.so.conf.d/opera.conf
    content: "{{ opera_path }}/CentOS7libs"
    backup: yes
  notify: ldconfig
  when: (ansible_distribution == "Fedora" and ansible_distribution_major_version >= "22")

- name: install RHEL 6 deps
  become: yes
julian.gethmann's avatar
julian.gethmann committed
70
71
  dnf:
    name: hwloc
julian.gethmann's avatar
julian.gethmann committed
72
    state: present
julian.gethmann's avatar
julian.gethmann committed
73
  when:
julian.gethmann's avatar
julian.gethmann committed
74
75
76
77
78
    (ansible_distribution == "CentOS" and ansible_distribution_major_version == "6") or
    (ansible_distribution == "RHEL" and ansible_distribution_major_version == "6")

- name: install RHEL 7 deps
  become: yes
julian.gethmann's avatar
julian.gethmann committed
79
80
  dnf:
    name: hwloc-libs
julian.gethmann's avatar
julian.gethmann committed
81
    state: present
julian.gethmann's avatar
julian.gethmann committed
82
  when:
julian.gethmann's avatar
julian.gethmann committed
83
84
85
86
87
88
    (ansible_distribution == "CentOS" and ansible_distribution_major_version == "7") or
    (ansible_distribution == "RHEL" and ansible_distribution_major_version == "7") or
    (ansible_distribution == "Fedora" and ansible_distribution_major_version >= "24")

- name: copy profile.d
  become: yes
julian.gethmann's avatar
julian.gethmann committed
89
  copy:
julian.gethmann's avatar
julian.gethmann committed
90
91
92
93
94
95
96
97
98
99
    src: opera.sh
    dest: /etc/profile.d/opera.sh
    backup: yes
    owner: root
    group: root
    mode: 0744
  notify: run custom

- name: copy wrapper scripts
  become: yes
julian.gethmann's avatar
julian.gethmann committed
100
  copy:
julian.gethmann's avatar
julian.gethmann committed
101
102
103
104
105
106
107
    src: "{{ item }}"
    dest: /usr/local/bin
    mode: ugo+x
  with_items:
    - "opera-mod.sh"
    - "opera-post.sh"
    - "opera-manager"