Skip to content

Commit

Permalink
Merge pull request #20 from CoffeeITWorks/develop
Browse files Browse the repository at this point in the history
update to molecule v3
  • Loading branch information
pablodav authored May 10, 2020
2 parents c70f087 + 15df776 commit 66e4c1a
Show file tree
Hide file tree
Showing 15 changed files with 84 additions and 128 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
1.8.1:
* update to molecule 3 and fix gevent install
1.8.0:

* upgrade to 0.6.6 see #15 https://github.com/CoffeeITWorks/ansible_burpui_server/issues/15
Expand Down
3 changes: 1 addition & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ burpui_pip_present:
- "Flask-Session"
- "Flask-Migrate"
- "celery>=4.0.2"
- "pip>=9"
- "cffi>=1.7"
- "gevent>=1.2"
- "gevent>=20.0.5"
- "ujson>=1.35"
- "urllib3>=1.19" # required to avoid issues with get_url module
# - "ndg-httpsclient>=0.4.2" # required to avoid issues with get_url module
Expand Down
9 changes: 0 additions & 9 deletions molecule/default/Dockerfile.j2

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
vars:
burpui_standalone: True
burpui_pip_burpui_dev: 'git+https://git.ziirish.me/ziirish/burp-ui.git@stable#egg=burp-ui'
burpui_use_dev: True
#burpui_use_dev: True # now in molecule.yml inventory group_vars
roles:
- role: ansible_burp2_server
- role: coffeeitworks.burp2_server
- role: ansible_burpui_server
tags:
- burpui-server
59 changes: 0 additions & 59 deletions molecule/default/create.yml

This file was deleted.

27 changes: 0 additions & 27 deletions molecule/default/destroy.yml

This file was deleted.

63 changes: 41 additions & 22 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,61 @@ dependency:
options:
ignore-certs: True
ignore-errors: True
role-file: requirements.yml
role-file: requirements.yml # this file is at the root of the git project same place as molecule is executed
driver:
name: docker
lint:
name: yamllint
platforms:
- name: ansible_test-01
image: paulfantom/debian-molecule:9
privileged: True

- name: ansible_burpui_server-01
image: "geerlingguy/docker-ubuntu1804-ansible:latest"
#privileged: True
command: /sbin/init
pre_build_image: true
capabilities:
- SYS_ADMIN
- SYS_ADMIN
tmpfs:
- /run
- /tmp
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:ro"
- "/sys/fs/cgroup:/sys/fs/cgroup:ro"
groups:
- use_pip_package

- name: ansible_burpui_server-02
image: "geerlingguy/docker-debian9-ansible"
#privileged: True
command: /sbin/init
pre_build_image: true
capabilities:
- SYS_ADMIN
tmpfs:
- /run
- /tmp
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:ro"
groups:
- group1
# In docker cannot be tested with centos 7 due to https://github.com/ansible/ansible-modules-core/issues/593
- name: ansible_test-03
image: centos/systemd
- use_pip_package

- name: ansible_burpui_server-03
image: docker.io/pycontribs/centos:7
pre_build_image: true
command: /sbin/init
capabilities:
- SYS_ADMIN
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:ro"
privileged: True
#privileged: True
groups:
- group1
- use_dev_package

provisioner:
name: ansible
config_options:
defaults:
callback_whitelist: profile_tasks
lint:
name: ansible-lint
scenario:
name: default
verifier:
name: testinfra
lint:
name: flake8
inventory:
group_vars:
use_pip_package:
burpui_use_dev: False
use_dev_package:
burpui_use_dev: True
5 changes: 0 additions & 5 deletions molecule/default/prepare.yml

This file was deleted.

9 changes: 9 additions & 0 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# This is an example playbook to execute Ansible tests.

- name: Verify
hosts: all
tasks:
- name: Example assertion
assert:
that: true
2 changes: 1 addition & 1 deletion requirements.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# from galaxy
- src: CoffeeITWorks.burp2_server
name: ansible_burp2_server
name: coffeeitworks.burp2_server
version: master
1 change: 1 addition & 0 deletions run_local_molecule.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Fedora local docker: https://success.docker.com/article/firewalld-problems-with-container-to-container-network-communications
# https://molecule.readthedocs.io/en/latest/examples.html#docker
docker run --rm -it --privileged=True \
-v "$(pwd)":/tmp/$(basename "${PWD}"):ro \
Expand Down
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
- include_tasks: gunicorn.yml

- include_tasks: bui-celery.yml
when: burpui_production_celery
when: burpui_production_celery | bool

# This is prepared for next 0.5.0 version
- include_tasks: bui-upgrade.yml
Expand Down
6 changes: 6 additions & 0 deletions tasks/python3_pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
register: burpui_installed_check
check_mode: yes

- name: pip3 | update pip
pip:
name: 'pip>=20'
state: present
executable: "{{ python3_pip }}"

- name: pip3 | install pip packages
pip:
name: '{{ burpui_pip_present }}'
Expand Down
11 changes: 11 additions & 0 deletions tasks/systemd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,16 @@
state: started
enabled: yes

# redis-server systemd ubuntu
- name: systemd | fix redis-server setup for systemd
lineinfile:
dest: "/etc/redis/redis.conf"
regexp: "{{ item.src }}"
line: "{{ item.value }}"
with_items:
- { src: '^supervised ' , value: 'supervised systemd' }
- { src: '^bind ' , value: 'bind 127.0.0.1' }
when: ansible_distribution == 'Ubuntu' and ansible_distribution_major_version|int >= 18

- name: flush handlers
meta: flush_handlers
9 changes: 9 additions & 0 deletions vars/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
burpui_system_absent:
- python3-cryptography

# For python2
burpui_system_requirements:
- python-pip
- python-setuptools
Expand All @@ -14,6 +15,10 @@ burpui_system_requirements:
- libffi-dev # dependency for cffi
- locales-all # required for python3
- gcc
- libev-dev # required for gevent
- musl-dev # required for gevent
- libevent-dev # required for gevent
- tzdata # required timezone installed for gunicorn

burpui_py3_packages:
- python3
Expand All @@ -24,6 +29,10 @@ burpui_py3_packages:
- libffi-dev # dependency for cffi
- locales-all # required for python3
- gcc
- libev-dev # required for gevent
- musl-dev # required for gevent
- libevent-dev # required for gevent
- tzdata # required timezone installed for gunicorn

burpui_packages:
- redis-server
Expand Down

0 comments on commit 66e4c1a

Please sign in to comment.