ansible.openmanage/tasks/main.yml

123 lines
3.6 KiB
YAML
Raw Normal View History

2018-11-23 15:19:21 +01:00
---
# .. vim: foldmarker=[[[,]]]:foldmethod=marker
#
# tasks file for netdata
# Manage repository [[[1
## Add repository
- name: Add OpenManage repository
apt_repository:
update_cache: False
repo: '{{ item.repo }}'
mode: '{{ item.mode | d(omit) }}'
filename: '{{ item.filename | d(omit) }}'
state: '{{ item.state | d("present") }}'
with_flattened:
- '{{ openmanage__repositories }}'
register: openmanage__register_repositories
until: openmanage__register_repositories is success
2018-11-23 15:19:21 +01:00
## Add repository key
- name: Add OpenManage repo key
apt_key:
url: '{{ item.key_url | d(omit) }}'
id: '{{ item.key_id | d(omit) }}'
keyserver: '{{ item.key_keyserver | d(omit) }}'
with_flattened:
- '{{ openmanage__repositories }}'
register: openmanage__register_key
until: openmanage__register_key is success
2018-11-23 15:19:21 +01:00
## Update cache
- name: Update APT cache
apt:
update_cache: '{{ True
if (openmanage__register_key is changed or
openmanage__register_repositories is changed)
else
False }}'
2019-02-27 14:34:12 +01:00
register: openmanage__register_update
until: openmanage__register_update is success
when: (openmanage__deploy_state == "present")
# Manage packages [[[1
2018-11-26 12:04:12 +01:00
## Manage depencies packages
- name: Ensure dependencies are present
package:
name: '{{ item }}'
state: "present"
install_recommends: '{{ openmanage__install_recommends | bool }}'
with_flattened:
- '{{ openmanage__dep_packages | to_nice_json }}'
2019-02-27 14:17:58 +01:00
register: pkg_dep_result
until: pkg_dep_result is success
2018-11-26 12:04:12 +01:00
when: (openmanage__deploy_state == "present")
## Manage base system packages
- name: Ensure base packages are in there desired state
package:
name: '{{ item }}'
state: '{{ "present" if (openmanage__deploy_state == "present") else "absent" }}'
install_recommends: '{{ openmanage__install_recommends | bool }}'
with_flattened:
- '{{ openmanage__base_packages | to_nice_json }}'
2019-02-27 14:17:58 +01:00
register: pkg_base_result
until: pkg_base_result is success
notify: ['restart dataeng service']
2018-11-26 11:53:23 +01:00
## Manage OMSA webgui packages
- name: Ensure OMSA-webgui packages are in there desired state
package:
name: '{{ item }}'
state: '{{ "present" if (openmanage__deploy_state == "present") and
(openmanage__webgui_state == "present")
else "absent" }}'
install_recommends: '{{ openmanage__install_recommends | bool }}'
with_flattened:
- '{{ openmanage__webgui_packages | to_nice_json }}'
register: pkg_webgui_result
until: pkg_webgui_result is success
notify: ['restart webgui service']
2018-11-26 11:53:23 +01:00
# Executable [[[1
## Fix some permissions
- name: Ensure Executables can be run
file:
path: /opt/dell/srvadmin/sbin/racadm-wrapper-idrac7
mode: 0755
2018-12-03 15:46:48 +01:00
when: (openmanage__deploy_state == "present")
2018-11-26 14:14:24 +01:00
## Fix RAC1170 error
- name: Fix libssl error RAC1170
file:
src: "/usr/lib/x86_64-linux-gnu/libssl.so.1.0.2"
path: "/opt/dell/srvadmin/lib64/libssl.so"
2018-11-26 14:14:24 +01:00
state: link
2018-12-03 15:46:48 +01:00
when: (openmanage__deploy_state == "present")
## Manage symlinks for OpenManage/racadm apps
- name: Ensure some Executables are in PATH
file:
src: "/opt/dell/srvadmin/sbin/{{ item }}"
path: "/bin/{{ item }}"
state: "link"
with_items:
- 'omconfig'
- 'omexec'
- 'omreport'
- 'omupdate'
- 'racadm'
when: (openmanage__deploy_state == "present")
- name: Remove Executables symlinks
file:
path: "/bin/{{ item }}"
state: "absent"
with_items:
- 'omconfig'
- 'omexec'
- 'omreport'
- 'omupdate'
- 'racadm'
when: (openmanage__deploy_state == "absent")