Przeglądaj źródła

Merge pull request #215 from michaelpporter/master

Adds OracleLinux install
Jared 6 lat temu
rodzic
commit
7cdcc8aa80

+ 1 - 0
.travis.yml

@@ -6,6 +6,7 @@ env:
   - SCENARIO=debian
   - SCENARIO=ubuntu
   - SCENARIO=centos
+  - SCENARIO=oraclelinux
   - SCENARIO=fedora
   - SCENARIO=amazonlinux
 services: docker

+ 2 - 0
defaults/main.yml

@@ -16,6 +16,8 @@ sensu_yum_key_url: "https://sensu.global.ssl.fastly.net/yum/pubkey.gpg"
 sensu_apt_repo_url: "deb     https://repositories.sensuapp.org/apt {{ ansible_distribution_release }} main"
 sensu_apt_key_url: "https://sensu.global.ssl.fastly.net/apt/pubkey.gpg"
 sensu_freebsd_url: "https://sensu.global.ssl.fastly.net/freebsd/FreeBSD:{{ ansible_distribution_major_version }}:{{ ansible_architecture }}/"
+sensu_ol_yum_repo_url: "https://dl.fedoraproject.org/pub/epel/$releasever/$basearch/"
+sensu_ol_yum_key_url: "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-$releasever"
 
 # Sensu service names
 sensu_server_service_name: sensu-server

+ 2 - 0
docs/index.md

@@ -29,11 +29,13 @@ This role requires Ansible 2.5
 - [Debian - 9 (Stretch)](https://wiki.debian.org/DebianStretch)
 - [Ubuntu - 14.04 (Trusty Tahr)](http://releases.ubuntu.com/14.04/)
 - [Ubuntu - 16.04 (Xenial Xerus)](http://releases.ubuntu.com/16.04/)
+- [Ubuntu - 18.04 (Xenial Xerus)](http://releases.ubuntu.com/18.04/)
 - [Fedora - 26](https://docs.fedoraproject.org/f26/release-notes/)
 - [Fedora - 27](https://docs.fedoraproject.org/f27/release-notes/)
 - [Fedora - 28](https://docs.fedoraproject.org/f28/release-notes/)
 - [Amazon Linux](https://aws.amazon.com/amazon-linux-ami/)
 - [Amazon Linux 2](https://aws.amazon.com/amazon-linux-2/)
+- [OracleLinux - 7](https://docs.oracle.com/cd/E52668_01/)
 
 ### Supported manually (compatibility not always guaranteed)
 

+ 14 - 0
molecule/oraclelinux/Dockerfile.j2

@@ -0,0 +1,14 @@
+# Molecule managed
+
+{% if item.registry is defined %}
+FROM {{ item.registry.url }}/{{ item.image }}
+{% else %}
+FROM {{ item.image }}
+{% endif %}
+
+RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
+    elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python2-dnf bash && dnf clean all; \
+    elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
+    elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml && zypper clean -a; \
+    elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \
+    elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi

+ 61 - 0
molecule/oraclelinux/molecule.yml

@@ -0,0 +1,61 @@
+---
+scenario:
+  name: oraclelinux
+dependency:
+  name: galaxy
+driver:
+  name: docker
+lint:
+  name: yamllint
+platforms:
+  - name: oraclelinux-7
+    image: dokken/oraclelinux-7
+    command: /usr/lib/systemd/systemd
+    capabilities:
+      - SYS_ADMIN
+    groups:
+      - sensu_checks
+    volumes:
+      - /sys/fs/cgroup:/sys/fs/cgroup:ro
+provisioner:
+  name: ansible
+  config_options:
+    defaults:
+      callback_whitelist: timer,profile_tasks
+      fact_caching: jsonfile
+      fact_caching_connection: ./cache
+      poll_interval: 3
+      forks: 100
+    connection:
+      pipelining: true
+  playbooks:
+    prepare: ../shared/prepare.yml
+    create: ../shared/create.yml
+    destroy: ../shared/destroy.yml
+    converge: ../shared/playbook.yml
+    verify: ../shared/verify.yml
+  lint:
+    name: ansible-lint
+  inventory:
+    group_vars:
+      all:
+        sensu_master: true
+        sensu_include_dashboard: true
+        sensu_rabbitmq_server: true
+        sensu_redis_server: true
+        sensu_rabbitmq_host: "{{ ansible_hostname }}"
+        sensu_redis_host: "{{ ansible_hostname }}"
+        sensu_api_host: "{{ ansible_hostname }}"
+        ansible_default_ipv4:
+          address: 127.0.0.1
+        sensu_remote_plugins:
+          - sensu-plugins-disk-checks
+        sensu_check_interval: 60
+    host_vars:
+      oraclelinux-7:
+        inspec_version: el7
+verifier:
+  name: inspec
+  directory: ../shared/tests/
+  lint:
+    name: rubocop

+ 10 - 0
tasks/CentOS/main.yml

@@ -20,6 +20,16 @@
       ) | ternary('no', 'yes') }}"
     enabled: yes
 
+- name: Ensure the epel present for OracleLinux
+  tags: setup
+  yum_repository:
+    name: epel
+    description: EPEL YUM repo
+    baseurl: "{{ sensu_ol_yum_repo_url }}"
+    gpgkey: "{{ sensu_ol_yum_key_url }}"
+    enabled: yes
+  when: ansible_distribution == 'OracleLinux'
+
 - name: Ensure that credential is supplied if installing Sensu Enterprise
   tags: setup
   assert:

+ 1 - 0
tasks/OracleLinux

@@ -0,0 +1 @@
+CentOS

+ 1 - 0
vars/OracleLinux.yml

@@ -0,0 +1 @@
+CentOS.yml