diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..84d28ed --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.tox \ No newline at end of file diff --git a/defaults/main.yaml b/defaults/main.yaml new file mode 100644 index 0000000..1f91654 --- /dev/null +++ b/defaults/main.yaml @@ -0,0 +1,19 @@ +# Copyright 2019, VEXXHOST, Inc. +# +# 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. + +openmanage_packages: + - srvadmin-server-cli + - srvadmin-storage-cli + +openmanage_install_monitoring_tools: false \ No newline at end of file diff --git a/meta/main.yaml b/meta/main.yaml new file mode 100644 index 0000000..f93353e --- /dev/null +++ b/meta/main.yaml @@ -0,0 +1,15 @@ +--- +galaxy_info: + role_name: openmanage + description: Install & configure OpenManage + license: Apache + + author: Mohammed Naser + company: VEXXHOST, Inc. + + min_ansible_version: 2.7 + + platforms: + - name: EL + versions: + - 7 \ No newline at end of file diff --git a/tasks/main.yaml b/tasks/main.yaml new file mode 100644 index 0000000..4ef0c63 --- /dev/null +++ b/tasks/main.yaml @@ -0,0 +1,31 @@ +# Copyright 2019, VEXXHOST, Inc. +# +# 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. + +- include_tasks: "setup-repo/{{ ansible_os_family | lower }}.yaml" + +- name: Install packages + become: true + package: + name: "{{ openmanage_packages }}" + state: present + +- name: Install check_openmanage + become: true + get_url: + url: http://folk.uio.no/trondham/software/check_openmanage-3.7.12/check_openmanage + dest: /usr/local/bin/check_openmanage + checksum: md5:9696bbb3fbc258ffaaa23fff3bd50f97 + mode: '0755' + when: + - openmanage_install_monitoring_tools | bool \ No newline at end of file diff --git a/tasks/setup-repo/redhat.yaml b/tasks/setup-repo/redhat.yaml new file mode 100644 index 0000000..f61ec8f --- /dev/null +++ b/tasks/setup-repo/redhat.yaml @@ -0,0 +1,41 @@ +# Copyright 2019, VEXXHOST, Inc. +# +# 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: Add dell-system-update_independent + become: true + yum_repository: + name: dell-system-update_independent + description: dell-system-update_independent + file: dell-system-update + baseurl: https://linux.dell.com/repo/hardware/dsu/os_independent/ + gpgcheck: true + gpgkey: + - https://linux.dell.com/repo/pgp_pubkeys/0x756ba70b1019ced6.asc + - https://linux.dell.com/repo/pgp_pubkeys/0x1285491434D8786F.asc + - https://linux.dell.com/repo/pgp_pubkeys/0xca77951d23b66a9d.asc + exclude: + - dell-system-update*.i386 + +- name: Add dell-system-update_dependent + become: true + yum_repository: + name: dell-system-update_dependent + description: dell-system-update_dependent + file: dell-system-update + mirrorlist: https://linux.dell.com/repo/hardware/dsu/mirrors.cgi?osname=el$releasever&basearch=$basearch&native=1 + gpgcheck: true + gpgkey: + - https://linux.dell.com/repo/pgp_pubkeys/0x756ba70b1019ced6.asc + - https://linux.dell.com/repo/pgp_pubkeys/0x1285491434D8786F.asc + - https://linux.dell.com/repo/pgp_pubkeys/0xca77951d23b66a9d.asc \ No newline at end of file diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..74df13d --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1 @@ +ansible-lint==4.1.0 \ No newline at end of file diff --git a/tests/run.yaml b/tests/run.yaml new file mode 100644 index 0000000..34a3815 --- /dev/null +++ b/tests/run.yaml @@ -0,0 +1,19 @@ +# Copyright 2019, VEXXHOST, Inc. +# +# 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. + +- hosts: all + roles: + - openmanage + vars: + openmanage_install_monitoring_tools: true diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..13b4900 --- /dev/null +++ b/tox.ini @@ -0,0 +1,9 @@ +[tox] +minversion = 2.0 +skipsdist = True + +[testenv:linters] +deps = + -r{toxinidir}/test-requirements.txt +commands = + ansible-lint . \ No newline at end of file diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml new file mode 100644 index 0000000..dc9717d --- /dev/null +++ b/zuul.d/jobs.yaml @@ -0,0 +1,24 @@ +# Copyright 2019, VEXXHOST, Inc. +# +# 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. + +- job: + name: ansible-role-openmanage-integration + parent: base + abstract: true + run: tests/run.yaml + +- job: + name: ansible-role-openmanage-integration-centos-7 + parent: ansible-role-openmanage-integration + nodeset: centos-7 diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml new file mode 100644 index 0000000..014decf --- /dev/null +++ b/zuul.d/project.yaml @@ -0,0 +1,23 @@ +# Copyright 2019, VEXXHOST, Inc. +# +# 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. + +- project: + check: + jobs: + - tox-linters + - ansible-role-openmanage-integration-centos-7 + gate: + jobs: + - tox-linters + - ansible-role-openmanage-integration-centos-7 \ No newline at end of file