---

- name: Install GPG Key for GrayLog repository
  copy:
    content: |
      -----BEGIN PGP PUBLIC KEY BLOCK-----
      Version: GnuPG v1
      
      mQENBFOPNl0BCADchW1E+WBds4CV+PMowuPn6yWdVIStj3+JcNxML8Bo8J1NtbLw
      GI4iPHNP9KiPROFfLRmARLF7d3/AtGoXh8BaTKjkJCBtBq/uQbmvcJojASpMg+/P
      7Ot2f+V8KGiTiOCsLcWKvxa6AIwHWatqclBZhmUgPzAGKQfXBd/7v0w+H07nMAzb
      RlJbJ/v8LYQloXaqaGXJduYBrzJ0l7g+lKJXs4A9TEMazO7dwlxE0v0YSL+fsKRx
      axo/Vyu1okkw0njR2wnB4xUtnPeJmdfumm5+4eMIV0pgBUYRCIbbiybjF88HLH3c
      KdOHi7LXkhvqP+niwn5N/wvtWNEJpZ4wbhYhABEBAAG0HlRPUkNIIEdtYkggPHBh
      Y2thZ2VzQHRvcmNoLnNoPokBOAQTAQIAIgUCU482XQIbAwYLCQgHAwIGFQgCCQoL
      BBYCAwECHgECF4AACgkQ1EwdjbFgbyILuwf/TyqXT/hahK1z/M/LPwmHoLxi8OTA
      fvk907WSQJ71GM9H0HsJRUtsNVGDu/tmRdIDl04vWDZS0Y39SF6aopOtYc1py3lS
      CcPrPLYtmCiRRMXuENp2K9Uo9RlDnM18M0WpZp7UYhYEX7JjM4IXm396+rPEM+Ia
      voJ3VHEq1er6eDhA7sLiRPHKOn92XYfnLRcY7Q+KsOAtzunpGEsycwu39yXeEFR1
      DnCw6Ym13dvtfbR138fbIfoQ+RxwexcJ4Fo6SyKdYMlMgjGYmyJcLRWvdNkDIP9p
      B0pRn/8zEuxqCN77Pbx7rlLTqXa1XAPsBI6NbA/kvdWl0MDZ+mzSYKFlZQ==
      =+gAB
      -----END PGP PUBLIC KEY BLOCK-----
    dest: /etc/pki/rpm-gpg/RPM-GPG-KEY-graylog
  tags: repo

- name: Configure GrayLog repository
  yum_repository:
    name: graylog
    description: GrayLog
    baseurl: https://packages.graylog2.org/repo/el/stable/{{ graylog_major_version }}/$basearch
    gpgcheck: True
    gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-graylog
  tags: repo
