Add role dev requirements

pull/199/head
Szymon Cader 4 years ago
parent f74adafe17
commit dc7d65be05
  1. 2
      .travis.yml
  2. 34
      molecule/default/converge.yml
  3. 1
      molecule/default/molecule.yml
  4. 41
      molecule/default/prepare.yml
  5. 8
      requirements.txt

@ -24,7 +24,7 @@ addons:
install:
- mv "$PWD" "${PWD%/*}/$ROLE_NAME"
# Install ansible
- pip install ansible molecule docker testinfra pytest pytest-xdist
- pip install -r requirements.txt
# Check ansible version
- ansible --version

@ -24,39 +24,5 @@
media_root: /var/www/media/
certificate: /etc/nginx/ssl/fullchain.pem # selfsigned
private_key: /etc/nginx/ssl/privkey.pem # selfsigned
pre_tasks:
- name: Update apt cache
apt: update_cache=yes cache_valid_time=600
become: yes
when: ansible_os_family == 'Debian'
changed_when: false
- name: "Create directories"
file:
path: /var/www/{{ item }}
state: directory
loop:
- static
- media
- name: "Create test file"
copy:
dest: /var/www/{{ item.directory }}/{{ item.file }}
content: "{{ item.directory }}"
loop:
- directory: static
file: static.html
- directory: static
file: cache.js
- directory: static
file: cache.css
- directory: media
file: media.html
- debug: var=ansible_python
tags: xd
- name: Run simple python server
shell:
cmd: "nohup {{ ansible_python.executable }} -m {{ 'http.server' if ansible_python.version.major == 3 else 'SimpleHTTPServer'}} &"
chdir: /tmp
tags: xd
roles:
- role: nginx

@ -26,4 +26,3 @@ verifier:
name: testinfra
options:
capture: no
# n: 2

@ -0,0 +1,41 @@
---
- name: Converge
hosts: all
remote_user: ansible
become: yes
tasks:
- name: Update apt cache
apt:
update_cache: yes
cache_valid_time: 600
become: yes
when: ansible_os_family == 'Debian'
changed_when: false
- name: "Create directories"
file:
path: /var/www/{{ item }}
state: directory
loop:
- static
- media
- name: "Create test file"
copy:
dest: /var/www/{{ item.directory }}/{{ item.file }}
content: "{{ item.directory }}"
loop:
- directory: static
file: static.html
- directory: static
file: cache.js
- directory: static
file: cache.css
- directory: media
file: media.html
- debug:
var: ansible_python
- name: Run simple python server
shell:
cmd: "nohup {{ ansible_python.executable }} -m {{ 'http.server' if ansible_python.version.major == 3 else 'SimpleHTTPServer'}} &"
chdir: /tmp

@ -0,0 +1,8 @@
ansible==2.9.10
ansible-lint==4.2.0
docker==4.2.1
molecule==3.0.4
pytest==5.4.3
requests==2.24.0
testinfra==5.2.1
yamllint==1.23.0