summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Peck <bill@pecknet.com>2020-03-06 14:15:07 -0500
committerBill Peck <bill@pecknet.com>2020-03-06 14:15:07 -0500
commit8e56e306cb88e3d4d09ce51a5dea136a24134fa3 (patch)
tree620f720efd8243bc26b5ee3fc530c0132bb983e7
parentc466ac9599985fc9050b5aad82af8cfd9fbdbd35 (diff)
parentc3a91c2911b49fb0a84b29abd6ebde4f3687a678 (diff)
Merge branch 'master' of ssh://softwarefactory-project.io:29418/ansible-role-dci-rhel-cki
Change-Id: I153f8dd0cbdbc5d124d97777fbfe31b6d771118e
-rw-r--r--ansible-role-dci-rhel-cki.spec2
-rw-r--r--molecule/default/molecule.yml1
-rw-r--r--tasks/main.yml44
3 files changed, 15 insertions, 32 deletions
diff --git a/ansible-role-dci-rhel-cki.spec b/ansible-role-dci-rhel-cki.spec
index 1d5debe..5b52fe0 100644
--- a/ansible-role-dci-rhel-cki.spec
+++ b/ansible-role-dci-rhel-cki.spec
@@ -12,7 +12,7 @@ Source0: ansible-role-dci-rhel-cki-%{version}.tar.gz
BuildArch: noarch
%description
-An Ansible role that use automated cki test
+An Ansible role that is used to automate cki testing
%prep
%setup -qc
diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml
index 417e623..0d217ee 100644
--- a/molecule/default/molecule.yml
+++ b/molecule/default/molecule.yml
@@ -13,6 +13,7 @@ platforms:
capabilities:
- SYS_ADMIN
provisioner:
+ log: true
name: ansible
connection_options:
ansible_user: centos
diff --git a/tasks/main.yml b/tasks/main.yml
index 0150cc4..94ddf4f 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -1,49 +1,31 @@
---
-# We should update the container image instead of installing stuff in it
-- name: Install git
- delegate_to: localhost
- yum:
- name: git
- state: present
-
-# We should update the container image instead of installing stuff in it
-- name: Add harness repository
- delegate_to: localhost
- yum_repository:
- name: harness
- description: harness
- baseurl: https://beaker-project.org/yum/harness/CentOS7/
- gpgcheck: no
-- name: Install restraint-client
- delegate_to: localhost
- yum:
- name: restraint-client
- state: present
-
# Because restraint needs a key (Ansible uses a password)
- name: Generate /root/.ssh/id_rsa
delegate_to: localhost
- shell: ssh-keygen -q -t rsa -f /root/.ssh/id_rsa -C "" -N ""
+ command: ssh-keygen -q -t rsa -f /root/.ssh/id_rsa -C "" -N ""
args:
creates: /root/.ssh/id_rsa
-- name: Copy /root/.ssh/id_rsa to SUT
+- name: Copy /root/.ssh/id_rsa to SUT # noqa 301
delegate_to: localhost
- shell: |
- /usr/bin/sshpass -p beaker ssh-copy-id -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@{{ fqdn }}
-- name: Process CKI jobs
+ command: |
+ /usr/bin/sshpass -p beaker ssh-copy-id -o StrictHostKeyChecking=no \
+ -o UserKnownHostsFile=/dev/null root@{{ fqdn }}
+- name: Process CKI jobs # noqa 301
delegate_to: localhost
shell: |
- xsltproc --stringparam jumpHost {{ local_repo_ip }} files/job2restraint.xsl cki_job.xml > processed_cki_job.xml
+ xsltproc --stringparam jumpHost {{ local_repo_ip }} \
+ files/job2restraint.xsl cki_job.xml > processed_cki_job.xml
-- name: Generate CKI playbook
+- name: Generate CKI playbook # noqa 301
delegate_to: localhost
shell: |
- xsltproc --stringparam sutHost {{ fqdn }} files/job2dciplaybook.xsl /etc/dci-rhel-agent/hooks/cki_job.xml > cki_playbook.yml
+ xsltproc --stringparam sutHost {{ fqdn }} files/job2dciplaybook.xsl \
+ /etc/dci-rhel-agent/hooks/cki_job.xml > cki_playbook.yml
- include_tasks: cki_playbook.yml
# Run the test
-- name: Execute restraint processed_cki_job.xml
+- name: Execute restraint processed_cki_job.xml # noqa 301
delegate_to: localhost
- shell: |
+ command: |
restraint --job processed_cki_job.xml --host 1=root@{{ fqdn }} -v