diff --git a/openstack-ansible-security/README.md b/README.md similarity index 100% rename from openstack-ansible-security/README.md rename to README.md diff --git a/openstack-ansible-security/defaults/main.yml b/defaults/main.yml similarity index 100% rename from openstack-ansible-security/defaults/main.yml rename to defaults/main.yml diff --git a/openstack-ansible-security/files/login_banner.txt b/files/login_banner.txt similarity index 100% rename from openstack-ansible-security/files/login_banner.txt rename to files/login_banner.txt diff --git a/openstack-ansible-security/handlers/main.yml b/handlers/main.yml similarity index 100% rename from openstack-ansible-security/handlers/main.yml rename to handlers/main.yml diff --git a/openstack-ansible-security/meta/main.yml b/meta/main.yml similarity index 100% rename from openstack-ansible-security/meta/main.yml rename to meta/main.yml diff --git a/run_tests.sh b/run_tests.sh new file mode 100755 index 00000000..2d736749 --- /dev/null +++ b/run_tests.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash -e -v -x +# Copyright 2015, Rackspace US, 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. + +ROLE_NAME=$(basename $(pwd)) + +pushd tests + ansible-playbook -i inventory --syntax-check --list-tasks test.yml -e rolename=${ROLE_NAME} +popd + +ansible-lint */*yml diff --git a/openstack-ansible-security/tasks/apt.yml b/tasks/apt.yml similarity index 100% rename from openstack-ansible-security/tasks/apt.yml rename to tasks/apt.yml diff --git a/openstack-ansible-security/tasks/auditd.yml b/tasks/auditd.yml similarity index 100% rename from openstack-ansible-security/tasks/auditd.yml rename to tasks/auditd.yml diff --git a/openstack-ansible-security/tasks/auth.yml b/tasks/auth.yml similarity index 100% rename from openstack-ansible-security/tasks/auth.yml rename to tasks/auth.yml diff --git a/openstack-ansible-security/tasks/boot.yml b/tasks/boot.yml similarity index 100% rename from openstack-ansible-security/tasks/boot.yml rename to tasks/boot.yml diff --git a/openstack-ansible-security/tasks/console.yml b/tasks/console.yml similarity index 100% rename from openstack-ansible-security/tasks/console.yml rename to tasks/console.yml diff --git a/openstack-ansible-security/tasks/file_perms.yml b/tasks/file_perms.yml similarity index 100% rename from openstack-ansible-security/tasks/file_perms.yml rename to tasks/file_perms.yml diff --git a/openstack-ansible-security/tasks/kernel.yml b/tasks/kernel.yml similarity index 100% rename from openstack-ansible-security/tasks/kernel.yml rename to tasks/kernel.yml diff --git a/openstack-ansible-security/tasks/mail.yml b/tasks/mail.yml similarity index 100% rename from openstack-ansible-security/tasks/mail.yml rename to tasks/mail.yml diff --git a/openstack-ansible-security/tasks/main.yml b/tasks/main.yml similarity index 100% rename from openstack-ansible-security/tasks/main.yml rename to tasks/main.yml diff --git a/openstack-ansible-security/tasks/misc.yml b/tasks/misc.yml similarity index 100% rename from openstack-ansible-security/tasks/misc.yml rename to tasks/misc.yml diff --git a/openstack-ansible-security/tasks/nfsd.yml b/tasks/nfsd.yml similarity index 100% rename from openstack-ansible-security/tasks/nfsd.yml rename to tasks/nfsd.yml diff --git a/openstack-ansible-security/tasks/services.yml b/tasks/services.yml similarity index 100% rename from openstack-ansible-security/tasks/services.yml rename to tasks/services.yml diff --git a/openstack-ansible-security/tasks/sshd.yml b/tasks/sshd.yml similarity index 100% rename from openstack-ansible-security/tasks/sshd.yml rename to tasks/sshd.yml diff --git a/openstack-ansible-security/templates/chrony.conf.j2 b/templates/chrony.conf.j2 similarity index 100% rename from openstack-ansible-security/templates/chrony.conf.j2 rename to templates/chrony.conf.j2 diff --git a/openstack-ansible-security/templates/osas-auditd.j2 b/templates/osas-auditd.j2 similarity index 100% rename from openstack-ansible-security/templates/osas-auditd.j2 rename to templates/osas-auditd.j2 diff --git a/tests/ansible.cfg b/tests/ansible.cfg new file mode 100644 index 00000000..6c8a3443 --- /dev/null +++ b/tests/ansible.cfg @@ -0,0 +1,2 @@ +[defaults] +roles_path = ../.. diff --git a/tests/inventory b/tests/inventory new file mode 100644 index 00000000..df8b5f69 --- /dev/null +++ b/tests/inventory @@ -0,0 +1,2 @@ +[all] +localhost ansible_connection=local diff --git a/tests/test.yml b/tests/test.yml new file mode 100644 index 00000000..942f6409 --- /dev/null +++ b/tests/test.yml @@ -0,0 +1,19 @@ +--- +# Copyright 2015, Rackspace US, 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: Playbook for role testing + hosts: localhost + roles: + - role: "{{ rolename }}" diff --git a/openstack-ansible-security/vars/main.yml b/vars/main.yml similarity index 100% rename from openstack-ansible-security/vars/main.yml rename to vars/main.yml