Refactor CI pipelien and enable molecule testing #1

Merged
xoxys merged 131 commits from molecule-dev into master 2019-03-25 21:23:40 +00:00
5 changed files with 14 additions and 46 deletions
Showing only changes of commit 5ff10d4f09 - Show all commits

View File

@ -48,15 +48,10 @@ nginx_open_ports:
- 443 - 443
nginx_tls_enabled: False nginx_tls_enabled: False
# You can deploy your certificates from a file or from content. # Source has to be a file
# If you enable nginx_tls_source_use_content you have to put the content of your cert files into
# nginx_tls_cert_file and nginx_tls_cert_file.
nginx_tls_source_use_content: False
# If you enable nginx_tls_source_use_files theses variables have to contain the path to your
# certificate files located on the ansible "master" host
nginx_tls_source_use_files: True
nginx_tls_cert_source: mycert.pem nginx_tls_cert_source: mycert.pem
nginx_tls_key_source: mykey.pem nginx_tls_key_source: mykey.pem
# Set the destination filename
nginx_tls_cert_file: mycert.pem nginx_tls_cert_file: mycert.pem
nginx_tls_key_file: mykey.pem nginx_tls_key_file: mykey.pem
# nginx_tls_dhparam_file: # defaults to not set # nginx_tls_dhparam_file: # defaults to not set

View File

@ -1,16 +0,0 @@
*******
Google Cloud Engine driver installation guide
*******
Requirements
============
* A GCE credentials rc file
* apache-libcloud
Install
=======
.. code-block:: bash
$ sudo pip install apache-libcloud

View File

@ -6,9 +6,11 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_hosts_file(host): def test_nginx_is_installed(host):
f = host.file('/etc/hosts') nginx = host.package("nginx")
assert nginx.is_installed
assert f.exists def test_nginx_running_and_enabled(host):
assert f.user == 'root' nginx = host.service("nginx")
assert f.group == 'xxx' assert nginx.is_running
assert nginx.is_enabled

View File

@ -36,7 +36,7 @@
owner: "{{ nginx_user }}" owner: "{{ nginx_user }}"
group: "{{ nginx_group }}" group: "{{ nginx_group }}"
mode: 0750 mode: 0750
with_items: loop:
- "{{ nginx_vhosts_dir }}" - "{{ nginx_vhosts_dir }}"
- "{{ nginx_vhosts_dir }}/default" - "{{ nginx_vhosts_dir }}/default"
@ -47,7 +47,7 @@
owner: root owner: root
group: root group: root
mode: 0640 mode: 0640
with_items: loop:
- /etc/nginx/sites-available - /etc/nginx/sites-available
- /etc/nginx/sites-enabled - /etc/nginx/sites-enabled
@ -88,7 +88,7 @@
name: "{{ item.name }}" name: "{{ item.name }}"
state: "{{ item.state }}" state: "{{ item.state }}"
persistent: "{{ item.persistent }}" persistent: "{{ item.persistent }}"
with_items: "{{ nginx_set_sebooleans }}" loop: "{{ nginx_set_sebooleans }}"
when: nginx_set_sebooleans is defined when: nginx_set_sebooleans is defined
- name: Fix selinux file context mappaing for pid file - name: Fix selinux file context mappaing for pid file

View File

@ -1,24 +1,11 @@
--- ---
- block: - block:
- name: Copy certs and private key (content) - name: Copy certs and private key
copy:
content: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
with_items:
- { src: "{{ nginx_tls_key_source }}", dest: '/etc/pki/tls/private/{{ nginx_tls_key_file }}', mode: '0600' }
- { src: "{{ nginx_tls_cert_source }}", dest: '/etc/pki/tls/certs/{{ nginx_tls_cert_file }}', mode: '0750' }
loop_control:
label: "{{ item.dest }}"
notify: __nginx_reload
when: nginx_tls_source_use_content
- name: Copy certs and private key (files)
copy: copy:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
mode: "{{ item.mode }}" mode: "{{ item.mode }}"
with_items: loop:
- { src: "{{ nginx_tls_key_source }}", dest: '/etc/pki/tls/private/{{ nginx_tls_key_file }}', mode: '0600' } - { src: "{{ nginx_tls_key_source }}", dest: '/etc/pki/tls/private/{{ nginx_tls_key_file }}', mode: '0600' }
- { src: "{{ nginx_tls_cert_source }}", dest: '/etc/pki/tls/certs/{{ nginx_tls_cert_file }}', mode: '0750' } - { src: "{{ nginx_tls_cert_source }}", dest: '/etc/pki/tls/certs/{{ nginx_tls_cert_file }}', mode: '0750' }
loop_control: loop_control: