#  Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
#
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.
---

- name: Set omnia.log file
  replace:
    path: /etc/ansible/ansible.cfg
    regexp: '#log_path = /var/log/ansible.log'
    replace: 'log_path = /var/log/omnia.log'
  tags: install

- name: Check OS support
  fail:
    msg: "{{ os_status }}"
  when: not(ansible_distribution == os_name and ansible_distribution_version >= os_version)
  register: os_value
  tags: install

- name: Disable SElinux
  selinux:
    state: disabled
  tags: install

- name: Status of SElinux
  fail:
    msg: "{{ selinux_status }}"
  when: ansible_selinux.status != 'disabled'
  register: selinux_value
  tags: install

- name: State of firewall
  service:
    name: firewalld
    state: started
    enabled: yes