opera.yml 3.6 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 26
  # src: /mnt/las-archiv1/system/Opera/18/Opera_RHEL7.tar.bz
    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
27
  dnf:
julian.gethmann's avatar
julian.gethmann committed
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
    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'

# Fedora 25 deps
# - name: uninstall libicu
#   dnf:
#     name: # libicu nicht machbar, da zu viel (inkl. thunderbird, texmaker, texlive-latex-bin, sddm, plasma-breeze, uvm. davon abhängen!
#     state: absent
#   become: yes
#   when: (ansible_distribution == "Fedora" and ansible_distribution_major_version >= "24")

# does not work either
# - name: link too new/missing libraries
julian.gethmann's avatar
julian.gethmann committed
49
#   file:
julian.gethmann's avatar
julian.gethmann committed
50 51 52 53 54 55 56 57 58
#     state: link
#     src: "{{ item[1] }}"
#     dest: "{{ opera_path }}/bin/{{ item[0] }}"
#   become: yes
#   with_items:
#     - ["libicui18n.so.50", "/usr/lib64/libicui18n.so"]
#     - ["libicuuc.so.50", "/usr/lib64/libicuuc.so"]
#     - ["libicudata.so.50", "/usr/lib64/libicudata.so"]

julian.gethmann's avatar
julian.gethmann committed
59
# Work around for Fedora 25 vs. CentOS 7
julian.gethmann's avatar
julian.gethmann committed
60 61
- name: create dir for CentOS 7 libs
  become: yes
julian.gethmann's avatar
julian.gethmann committed
62
  file:
julian.gethmann's avatar
julian.gethmann committed
63 64 65 66 67 68
    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
julian.gethmann's avatar
julian.gethmann committed
69
  copy:
julian.gethmann's avatar
julian.gethmann committed
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
    src: "/mnt/las-archiv1/system/Opera/18/CentOS7libs/{{ item.src }}"
    dest: "{{ opera_path }}/CentOS7libs/{{ item.dest }}"
  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
89 90
  dnf:
    name: hwloc
julian.gethmann's avatar
julian.gethmann committed
91
    state: present
julian.gethmann's avatar
julian.gethmann committed
92
  when:
julian.gethmann's avatar
julian.gethmann committed
93 94 95 96 97
    (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
98 99
  dnf:
    name: hwloc-libs
julian.gethmann's avatar
julian.gethmann committed
100
    state: present
julian.gethmann's avatar
julian.gethmann committed
101
  when:
julian.gethmann's avatar
julian.gethmann committed
102 103 104 105 106 107
    (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
108
  copy:
julian.gethmann's avatar
julian.gethmann committed
109 110 111 112 113 114 115 116 117 118
    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
119
  copy:
julian.gethmann's avatar
julian.gethmann committed
120 121 122 123 124 125 126
    src: "{{ item }}"
    dest: /usr/local/bin
    mode: ugo+x
  with_items:
    - "opera-mod.sh"
    - "opera-post.sh"
    - "opera-manager"