---
- name: Stackdriver Logging | RedHat | Install the Python bindings for SELinux
  yum: name=libselinux-python state=present

- name: Stackdriver Logging | RedHat | Add the Stackdriver repository
  yum_repository:
    name: google-cloud-logging
    description: Google Cloud Logging Agent Repository
    baseurl: "{{ stackdriver_log_yum_repo }}"
    file: google-cloud-logging
    enabled: yes
    gpgcheck: yes
    repo_gpgcheck: yes
    gpgkey: "{{ stackdriver_log_yum_gpg_key }}"

- name: Stackdriver Logging | RedHat | Install Stackdriver agent
  yum:
    name: "{{ stackdriver_log_package_name }}"
    state: present
  notify: Stackdriver Logging | Restart Stackdriver Agent
