diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index 9e7ad36..0f7426a 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -13,15 +13,13 @@ changed_when: false when: ansible_os_family == 'Debian' - - name: Install rsync on instance + - name: Install required packages package: - name: rsync - state: latest - - - name: Install make - package: - name: make - state: latest + name: + - rsync + - make + - openssl + state: present roles: - role: ansible-role-csrmake diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml new file mode 100644 index 0000000..b075625 --- /dev/null +++ b/molecule/default/verify.yml @@ -0,0 +1,37 @@ +--- +- name: Verify + hosts: all + become: true + tasks: + + - name: Run the csrmake script + shell: | + echo 'devnull@localhost + foo.example.com + + CA + Some-state + SomeCity + Internet Widgits Pty Ltd + OrgUnitName + foo.example.com + nobody@example.com + + CompanyName + + ' | /usr/local/ssl/csrmake_sha256.sh + args: + executable: /bin/bash + + - name: Collect the contents of private dir + find: + paths: /usr/local/ssl/private/ + patterns: '*.key.*' + file_type: file + register: find_result + + - assert: + that: + - find_result.matched == 1 + fail_msg: "No 'key' files were found" + success_msg: "Private key file was generated"