opera.yml 2.96 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
    name: "{{ opera_path }}/CentOS7libs"
    state: directory
julian.gethmann's avatar
julian.gethmann committed
44 45
    group: users
    mode: g+rwx
julian.gethmann's avatar
julian.gethmann committed
46 47 48 49
  when: (ansible_distribution == "Fedora" and ansible_distribution_major_version >= "22")

- name: copy libraries from real CentOS 7 host (server)
  become: yes
50
  become_user: gethmann  # see above
julian.gethmann's avatar
julian.gethmann committed
51
  copy:
julian.gethmann's avatar
julian.gethmann committed
52 53
    src: "/mnt/las-archiv1/system/Opera/18/CentOS7libs/{{ item.src }}"
    dest: "{{ opera_path }}/CentOS7libs/{{ item.dest }}"
54
    remote_src: True
julian.gethmann's avatar
julian.gethmann committed
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
  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
72 73
  dnf:
    name: hwloc
julian.gethmann's avatar
julian.gethmann committed
74
    state: present
julian.gethmann's avatar
julian.gethmann committed
75
  when:
julian.gethmann's avatar
julian.gethmann committed
76 77 78 79 80
    (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
81 82
  dnf:
    name: hwloc-libs
julian.gethmann's avatar
julian.gethmann committed
83
    state: present
julian.gethmann's avatar
julian.gethmann committed
84
  when:
julian.gethmann's avatar
julian.gethmann committed
85 86 87 88 89 90
    (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
91
  copy:
julian.gethmann's avatar
julian.gethmann committed
92 93 94 95 96 97 98 99 100 101
    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
102
  copy:
julian.gethmann's avatar
julian.gethmann committed
103 104 105 106 107 108 109
    src: "{{ item }}"
    dest: /usr/local/bin
    mode: ugo+x
  with_items:
    - "opera-mod.sh"
    - "opera-post.sh"
    - "opera-manager"