diff --git a/.github/workflows/galaxy-notify.yml b/.github/workflows/galaxy-notify.yml new file mode 100644 index 0000000..9500246 --- /dev/null +++ b/.github/workflows/galaxy-notify.yml @@ -0,0 +1,69 @@ +--- +name: Molecule release +on: + push: + branches: + - "master" + # Sequence of patterns matched against refs/tags + tags: + - "[0-9]+.[0-9]+.[0-9]+" + +jobs: + molecule: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + # Better to use one scenario per OS for faster performance and easier debugging + scenario: + # - centos-8 + - ubuntu-2004 + steps: + + - name: Checkout + uses: actions/checkout@v2 + with: + path: "${{ github.repository }}" + + - name: Molecule converge + uses: gofrolist/molecule-action@v2 + with: + molecule_options: --debug --base-config molecule/_shared/base.yml + molecule_command: converge + # Always specify scenario and don't use default for better different use cases + molecule_args: --scenario-name ${{ matrix.scenario }} + env: + PY_COLORS: '1' + ANSIBLE_FORCE_COLOR: '1' + - name: Molecule syntax + uses: gofrolist/molecule-action@v2 + with: + molecule_options: --debug --base-config molecule/_shared/base.yml + molecule_command: syntax + # Always specify scenario and don't use default for better different use cases + molecule_args: --scenario-name ${{ matrix.scenario }} + env: + PY_COLORS: '1' + ANSIBLE_FORCE_COLOR: '1' + - name: Molecule idempotence + uses: gofrolist/molecule-action@v2 + with: + molecule_options: --debug --base-config molecule/_shared/base.yml + molecule_command: idempotence + # Always specify scenario and don't use default for better different use cases + molecule_args: --scenario-name ${{ matrix.scenario }} + env: + PY_COLORS: '1' + ANSIBLE_FORCE_COLOR: '1' + +# https://github.com/marketplace/actions/publish-ansible-role-to-galaxy +# Don't forget to add the secret galaxy_api_key in your repository + release: + runs-on: ubuntu-latest + needs: + - molecule + steps: + - name: galaxy + uses: robertdebock/galaxy-action@1.1.0 + with: + galaxy_api_key: ${{ secrets.galaxy_api_key }} diff --git a/.github/workflows/molecule-test.yml b/.github/workflows/molecule-test.yml new file mode 100644 index 0000000..2f2a9fe --- /dev/null +++ b/.github/workflows/molecule-test.yml @@ -0,0 +1,59 @@ +name: Molecule pipeline test + +on: + push: + branches-ignore: + - "master" + tags-ignore: + - "*" + pull_request: + pull_request_review: + +jobs: + molecule: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + # Better to use one scenario per OS for faster performance and easier debugging + scenario: + - centos-8 + - ubuntu-2004 + - stable-ubuntu-1804 + steps: + + - name: Checkout + uses: actions/checkout@v2 + with: + path: "${{ github.repository }}" + + - name: Molecule converge + uses: gofrolist/molecule-action@v2 + with: + molecule_options: --debug --base-config molecule/_shared/base.yml + molecule_command: converge + # Always specify scenario and don't use default for better different use cases + molecule_args: --scenario-name ${{ matrix.scenario }} + env: + PY_COLORS: '1' + ANSIBLE_FORCE_COLOR: '1' + - name: Molecule syntax + uses: gofrolist/molecule-action@v2 + with: + molecule_options: --debug --base-config molecule/_shared/base.yml + molecule_command: syntax + # Always specify scenario and don't use default for better different use cases + molecule_args: --scenario-name ${{ matrix.scenario }} + env: + PY_COLORS: '1' + ANSIBLE_FORCE_COLOR: '1' + - name: Molecule idempotence + uses: gofrolist/molecule-action@v2 + with: + molecule_options: --debug --base-config molecule/_shared/base.yml + molecule_command: idempotence + # Always specify scenario and don't use default for better different use cases + molecule_args: --scenario-name ${{ matrix.scenario }} + env: + PY_COLORS: '1' + ANSIBLE_FORCE_COLOR: '1' diff --git a/.gitignore b/.gitignore index e531658..2d87979 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,4 @@ # Created by .ignore support plugin (hsz.mobi) -### Ansible template -*.retry ### JetBrains template # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 @@ -8,9 +6,11 @@ # User-specific stuff: .idea/workspace.xml .idea/tasks.xml +.idea/dictionaries +.idea/vcs.xml +.idea/jsLibraryMappings.xml # Sensitive or high-churn files: -.idea/dataSources/ .idea/dataSources.ids .idea/dataSources.xml .idea/dataSources.local.xml @@ -45,13 +45,19 @@ crashlytics.properties crashlytics-build.properties fabric.properties -.idea/ansible_burpui_server.iml -.idea/markdown-navigator.xml -.idea/markdown-navigator/ -.idea/misc.xml -.idea/modules.xml +# vagrant +.vagrant -.kdev4 +# molecule +.molecule + +# jetbrains +.idea + +# kdevelop *.kdev4 +.kdev4 -.molecule \ No newline at end of file +# VSCode +.vscode +.cache diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 50f5a96..10d7280 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,9 +15,9 @@ install: #- ansible-galaxy install -r requirements.yml script: - - molecule --debug create - - molecule converge - - molecule syntax + - molecule --debug create -s default + - molecule converge -s default + - molecule syntax -s default #- molecule idempotence notifications: diff --git a/CHANGELOG b/CHANGELOG index 22aff57..ada9673 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +2.0.0: +* Remove python2 support +* Update tests to github actions +* support ubuntu 2004 +* no more support for old OS versions + 1.8.1: * update to molecule 3 and fix gevent install 1.8.0: diff --git a/README.md b/README.md index c59d356..b62ce95 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/CoffeeITWorks/ansible_burpui_server.svg?branch=master)](https://travis-ci.org/CoffeeITWorks/ansible_burpui_server) +[![Molecule pipeline test](https://github.com/CoffeeITWorks/ansible_burpui_server/actions/workflows/molecule-test.yml/badge.svg)](https://github.com/CoffeeITWorks/ansible_burpui_server/actions/workflows/molecule-test.yml) Getting Started ================ diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 82b1e16..0000000 --- a/circle.yml +++ /dev/null @@ -1,22 +0,0 @@ -machine: - python: - version: 2.7.10 - -dependencies: - pre: - - sudo apt-get install software-properties-common - - sudo apt-add-repository ppa:ansible/ansible -y - - sudo apt-get update - - sudo apt-get install ansible - - ansible-galaxy install -r requirements.yml - -test: - override: - # Check the role/playbook's syntax - - ansible-playbook -i tests/inventory tests/test.yml --syntax-check - # Check with ansible-lint - # - ansible-lint playbook.yml - # Run the basic role - - sudo ansible-playbook -i tests/inventory tests/test.yml --connection=local --become - - diff --git a/defaults/main.yml b/defaults/main.yml index 84464f3..4130e22 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -7,7 +7,7 @@ burpui_use_dev: False burpui_pip_burpui: "burp-ui" burpui_version: 0.6.6 -python_pip_executable: "pip3" # options pip3 / pip2 +python_pip_executable: "pip3" # pip3 only supported option burpui_pip_packages: - { name: "{{ burpui_pip_burpui }}", version: "{{ burpui_version }}" } @@ -18,22 +18,54 @@ burpui_pip_packages: - { name: "{{ burpui_pip_burpui }}[celery]", version: "{{ burpui_version }}" } - { name: "{{ burpui_pip_burpui }}[websocket]", version: "{{ burpui_version }}" } +# https://git.ziirish.me/ziirish/burp-ui/-/blob/master/requirements.txt +burpui_pip_dev_present: + #- "cryptography" + - "redis==3.5.3" + #- "Flask-Migrate" + - "celery>=5.1.0" + - "cffi>=1.14.5" + - "gevent>=21.1.2" + - "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 + - "pyasn1==0.4.8" + #- "six>=1.10.0" # try to fix error in dependencies with requests[security] + - "requests[security]>=2.12" # required to avoid issues with get_url module + - "Flask-Limiter==1.4" + - trio>=0.18.0 + - Flask>=1.1.2 + - Flask-Login>=0.5.0 + - Flask-Bower>=1.3.0 + - Flask-Babel>=2.0.0 + - Flask-WTF>=0.14.3 + - flask-restx>=0.3.0 + - Flask-Caching>=1.10.1 + - Flask-Session>=0.3.2 + - WTForms>=2.3.3 + - arrow>=0.14.2 + - pluginbase>=1.0.0 + - tzlocal>=2.1 + - pyOpenSSL>=20.0.1 + - configobj>=5.0.6 + - async_generator>=1.10 + - Click>=7.1.2 + burpui_pip_present: - - "cryptography" - - "redis" - - "Flask-Session" - - "Flask-Migrate" - - "celery>=4.0.2" - - "cffi>=1.7" - - "gevent>=20.0.5" + #- "cryptography" + - "redis==3.5.3" + #- "Flask-Migrate" + - "celery>=5.1.0" + - "cffi>=1.14.5" + - "gevent>=21.1.2" - "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 - - "pyasn1" - - "six>=1.10.0" # try to fix error in dependencies with requests[security] + - "pyasn1==0.4.8" + #- "six>=1.10.0" # try to fix error in dependencies with requests[security] - "requests[security]>=2.12" # required to avoid issues with get_url module - - "flask-limiter" - + + burpui_nginx_port: "8080" # This is to check availability and nginx template as reverse proxy burpui_global_port: "5000" diff --git a/requirements.yml b/dev_requirements.yml similarity index 100% rename from requirements.yml rename to dev_requirements.yml diff --git a/molecule/centos-8/converge.yml b/molecule/centos-8/converge.yml new file mode 100644 index 0000000..2081e90 --- /dev/null +++ b/molecule/centos-8/converge.yml @@ -0,0 +1,12 @@ +--- +- name: Converge + hosts: all + vars: + burpui_standalone: True + burpui_pip_burpui_dev: 'git+https://git.ziirish.me/ziirish/burp-ui.git@master#egg=burp-ui' + burpui_use_dev: True + roles: + # - role: coffeeitworks.burp2_server + - role: ansible_burpui_server + tags: + - burpui-server diff --git a/molecule/centos-8/molecule.yml b/molecule/centos-8/molecule.yml new file mode 100644 index 0000000..196633d --- /dev/null +++ b/molecule/centos-8/molecule.yml @@ -0,0 +1,34 @@ +--- +dependency: + name: galaxy + options: + ignore-certs: True + ignore-errors: True + role-file: dev_requirements.yml # this file is at the root of the git project same place as molecule is executed +driver: + name: docker +platforms: + + - name: ansible_burpui_server-04 + image: "geerlingguy/docker-centos8-ansible" + command: /sbin/init + privileged: True + pre_build_image: true + capabilities: + - SYS_ADMIN + tmpfs: + - /run + - /tmp + volumes: + - "/sys/fs/cgroup:/sys/fs/cgroup:ro" + groups: + - use_pip_package + +provisioner: + name: ansible + config_options: + defaults: + callback_whitelist: profile_tasks + ssh_connection: + pipelining: true + ssh_args: -o ControlMaster=auto -o ControlPersist=60s diff --git a/molecule/centos-8/verify.yml b/molecule/centos-8/verify.yml new file mode 100644 index 0000000..a82dd6f --- /dev/null +++ b/molecule/centos-8/verify.yml @@ -0,0 +1,9 @@ +--- +# This is an example playbook to execute Ansible tests. + +- name: Verify + hosts: all + tasks: + - name: Example assertion + assert: + that: true diff --git a/molecule/default/INSTALL.rst b/molecule/default/INSTALL.rst deleted file mode 100644 index e26493b..0000000 --- a/molecule/default/INSTALL.rst +++ /dev/null @@ -1,16 +0,0 @@ -******* -Install -******* - -Requirements -============ - -* Docker Engine -* docker-py - -Install -======= - -.. code-block:: bash - - $ sudo pip install docker-py diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index 605331c..2075c8f 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -3,8 +3,8 @@ hosts: all 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 # now in molecule.yml inventory group_vars + burpui_pip_burpui_dev: 'git+https://git.ziirish.me/ziirish/burp-ui.git@master#egg=burp-ui' + burpui_use_dev: True roles: - role: coffeeitworks.burp2_server - role: ansible_burpui_server diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 5b8a076..87328c2 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -4,14 +4,14 @@ dependency: options: ignore-certs: True ignore-errors: True - role-file: requirements.yml # this file is at the root of the git project same place as molecule is executed + role-file: dev_requirements.yml # this file is at the root of the git project same place as molecule is executed driver: name: docker platforms: - - name: ansible_burpui_server-01 - image: "geerlingguy/docker-ubuntu1804-ansible:latest" - #privileged: True + - name: ansible_burpui_server-03 + image: "geerlingguy/docker-debian10-ansible" + privileged: True command: /sbin/init pre_build_image: true capabilities: @@ -24,10 +24,10 @@ platforms: groups: - use_pip_package - - name: ansible_burpui_server-02 - image: "geerlingguy/docker-debian9-ansible" - #privileged: True + - name: ansible_burpui_server-04 + image: "geerlingguy/docker-centos8-ansible" command: /sbin/init + privileged: True pre_build_image: true capabilities: - SYS_ADMIN @@ -39,26 +39,11 @@ platforms: groups: - 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 - groups: - - use_dev_package - provisioner: name: ansible config_options: defaults: callback_whitelist: profile_tasks - inventory: - group_vars: - use_pip_package: - burpui_use_dev: False - use_dev_package: - burpui_use_dev: True + ssh_connection: + pipelining: true + ssh_args: -o ControlMaster=auto -o ControlPersist=60s diff --git a/molecule/default/tests/test_default.py b/molecule/default/tests/test_default.py deleted file mode 100644 index eedd64a..0000000 --- a/molecule/default/tests/test_default.py +++ /dev/null @@ -1,14 +0,0 @@ -import os - -import testinfra.utils.ansible_runner - -testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') - - -def test_hosts_file(host): - f = host.file('/etc/hosts') - - assert f.exists - assert f.user == 'root' - assert f.group == 'root' diff --git a/molecule/default/tests/test_default.pyc b/molecule/default/tests/test_default.pyc deleted file mode 100644 index 6cb1388..0000000 Binary files a/molecule/default/tests/test_default.pyc and /dev/null differ diff --git a/molecule/local-stable/converge.yml b/molecule/local-stable/converge.yml new file mode 100644 index 0000000..ec44dd8 --- /dev/null +++ b/molecule/local-stable/converge.yml @@ -0,0 +1,11 @@ +--- +- name: Converge + hosts: all + vars: + burpui_standalone: True + burpui_use_dev: False + roles: + # - role: coffeeitworks.burp2_server + - role: ansible_burpui_server + tags: + - burpui-server diff --git a/molecule/local-stable/molecule.yml b/molecule/local-stable/molecule.yml new file mode 100644 index 0000000..25bf3a1 --- /dev/null +++ b/molecule/local-stable/molecule.yml @@ -0,0 +1,49 @@ +--- +dependency: + name: galaxy + options: + ignore-certs: True + ignore-errors: True + role-file: dev_requirements.yml # this file is at the root of the git project same place as molecule is executed +driver: + name: podman +platforms: + + - name: ansible_burpui_stable_server-01 + image: "geerlingguy/docker-ubuntu2004-ansible:latest" + #privileged: True + command: "/lib/systemd/systemd" + pre_build_image: true + capabilities: + - SYS_ADMIN + tmpfs: + - /run + - /tmp + volumes: + - "/sys/fs/cgroup:/sys/fs/cgroup:ro" + groups: + - group1 + + - name: ansible_burpui_stable_server-04 + image: "geerlingguy/docker-centos8-ansible" + command: /usr/sbin/init + #privileged: True + pre_build_image: true + capabilities: + - SYS_ADMIN + tmpfs: + - /run + - /tmp + volumes: + - "/sys/fs/cgroup:/sys/fs/cgroup:ro" + groups: + - use_pip_package + +provisioner: + name: ansible + config_options: + defaults: + callback_whitelist: profile_tasks + ssh_connection: + pipelining: false + ssh_args: -o ControlMaster=auto -o ControlPersist=60s diff --git a/molecule/local-stable/verify.yml b/molecule/local-stable/verify.yml new file mode 100644 index 0000000..a82dd6f --- /dev/null +++ b/molecule/local-stable/verify.yml @@ -0,0 +1,9 @@ +--- +# This is an example playbook to execute Ansible tests. + +- name: Verify + hosts: all + tasks: + - name: Example assertion + assert: + that: true diff --git a/molecule/local/converge.yml b/molecule/local/converge.yml new file mode 100644 index 0000000..2081e90 --- /dev/null +++ b/molecule/local/converge.yml @@ -0,0 +1,12 @@ +--- +- name: Converge + hosts: all + vars: + burpui_standalone: True + burpui_pip_burpui_dev: 'git+https://git.ziirish.me/ziirish/burp-ui.git@master#egg=burp-ui' + burpui_use_dev: True + roles: + # - role: coffeeitworks.burp2_server + - role: ansible_burpui_server + tags: + - burpui-server diff --git a/molecule/local/molecule.yml b/molecule/local/molecule.yml new file mode 100644 index 0000000..b5aa669 --- /dev/null +++ b/molecule/local/molecule.yml @@ -0,0 +1,49 @@ +--- +dependency: + name: galaxy + options: + ignore-certs: True + ignore-errors: True + role-file: dev_requirements.yml # this file is at the root of the git project same place as molecule is executed +driver: + name: podman +platforms: + + - name: ansible_burpui_server-01 + image: "geerlingguy/docker-ubuntu2004-ansible:latest" + #privileged: True + command: "/lib/systemd/systemd" + pre_build_image: true + capabilities: + - SYS_ADMIN + tmpfs: + - /run + - /tmp + volumes: + - "/sys/fs/cgroup:/sys/fs/cgroup:ro" + groups: + - group1 + + - name: ansible_burpui_server-04 + image: "geerlingguy/docker-centos8-ansible" + command: /usr/sbin/init + #privileged: True + pre_build_image: true + capabilities: + - SYS_ADMIN + tmpfs: + - /run + - /tmp + volumes: + - "/sys/fs/cgroup:/sys/fs/cgroup:ro" + groups: + - use_pip_package + +provisioner: + name: ansible + config_options: + defaults: + callback_whitelist: profile_tasks + ssh_connection: + pipelining: false + ssh_args: -o ControlMaster=auto -o ControlPersist=60s diff --git a/molecule/local/verify.yml b/molecule/local/verify.yml new file mode 100644 index 0000000..a82dd6f --- /dev/null +++ b/molecule/local/verify.yml @@ -0,0 +1,9 @@ +--- +# This is an example playbook to execute Ansible tests. + +- name: Verify + hosts: all + tasks: + - name: Example assertion + assert: + that: true diff --git a/molecule/stable-ubuntu-1804/converge.yml b/molecule/stable-ubuntu-1804/converge.yml new file mode 100644 index 0000000..21aa8e2 --- /dev/null +++ b/molecule/stable-ubuntu-1804/converge.yml @@ -0,0 +1,12 @@ +--- +- name: Converge + hosts: all + vars: + burpui_standalone: True + # burpui_pip_burpui_dev: 'git+https://git.ziirish.me/ziirish/burp-ui.git@master#egg=burp-ui' + burpui_use_dev: False + roles: + #- role: coffeeitworks.burp2_server + - role: ansible_burpui_server + tags: + - burpui-server diff --git a/molecule/stable-ubuntu-1804/molecule.yml b/molecule/stable-ubuntu-1804/molecule.yml new file mode 100644 index 0000000..979c6c3 --- /dev/null +++ b/molecule/stable-ubuntu-1804/molecule.yml @@ -0,0 +1,34 @@ +--- +dependency: + name: galaxy + options: + ignore-certs: True + ignore-errors: True + role-file: dev_requirements.yml # this file is at the root of the git project same place as molecule is executed +driver: + name: docker +platforms: + + - name: ansible_burpui_server-03 + image: "geerlingguy/docker-ubuntu1804-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: + - use_pip_package + +provisioner: + name: ansible + config_options: + defaults: + callback_whitelist: profile_tasks + ssh_connection: + pipelining: true + ssh_args: -o ControlMaster=auto -o ControlPersist=60s diff --git a/molecule/stable-ubuntu-1804/verify.yml b/molecule/stable-ubuntu-1804/verify.yml new file mode 100644 index 0000000..a82dd6f --- /dev/null +++ b/molecule/stable-ubuntu-1804/verify.yml @@ -0,0 +1,9 @@ +--- +# This is an example playbook to execute Ansible tests. + +- name: Verify + hosts: all + tasks: + - name: Example assertion + assert: + that: true diff --git a/molecule/ubuntu-2004/converge.yml b/molecule/ubuntu-2004/converge.yml new file mode 100644 index 0000000..2081e90 --- /dev/null +++ b/molecule/ubuntu-2004/converge.yml @@ -0,0 +1,12 @@ +--- +- name: Converge + hosts: all + vars: + burpui_standalone: True + burpui_pip_burpui_dev: 'git+https://git.ziirish.me/ziirish/burp-ui.git@master#egg=burp-ui' + burpui_use_dev: True + roles: + # - role: coffeeitworks.burp2_server + - role: ansible_burpui_server + tags: + - burpui-server diff --git a/molecule/ubuntu-2004/molecule.yml b/molecule/ubuntu-2004/molecule.yml new file mode 100644 index 0000000..ce99657 --- /dev/null +++ b/molecule/ubuntu-2004/molecule.yml @@ -0,0 +1,34 @@ +--- +dependency: + name: galaxy + options: + ignore-certs: True + ignore-errors: True + role-file: dev_requirements.yml # this file is at the root of the git project same place as molecule is executed +driver: + name: docker +platforms: + + - name: ansible_burpui_server-03 + image: "geerlingguy/docker-ubuntu2004-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: + - use_pip_package + +provisioner: + name: ansible + config_options: + defaults: + callback_whitelist: profile_tasks + ssh_connection: + pipelining: true + ssh_args: -o ControlMaster=auto -o ControlPersist=60s diff --git a/molecule/ubuntu-2004/verify.yml b/molecule/ubuntu-2004/verify.yml new file mode 100644 index 0000000..a82dd6f --- /dev/null +++ b/molecule/ubuntu-2004/verify.yml @@ -0,0 +1,9 @@ +--- +# This is an example playbook to execute Ansible tests. + +- name: Verify + hosts: all + tasks: + - name: Example assertion + assert: + that: true diff --git a/python3_support.txt b/python3_support.txt deleted file mode 100644 index 930938d..0000000 --- a/python3_support.txt +++ /dev/null @@ -1,15 +0,0 @@ -Debian 9 python 3.5 issues: - -pip3 install flask-limiter -Collecting flask-limiter -From cffi callback : -Traceback (most recent call last): - File "/usr/local/lib/python3.5/dist-packages/OpenSSL/SSL.py", line 313, in wrapper - _lib.X509_up_ref(x509) -AttributeError: module 'lib' has no attribute 'X509_up_ref' - Could not find a version that satisfies the requirement flask-limiter (from versions: ) -No matching distribution found for flask-limiter - - ---- - diff --git a/tasks/bui-celery.yml b/tasks/bui-celery.yml index efd5b70..8140b0d 100644 --- a/tasks/bui-celery.yml +++ b/tasks/bui-celery.yml @@ -6,8 +6,10 @@ path: /var/spool/burpui state: directory -- include_tasks: supervisor.yml +- name: include supervisord tasks [DEPRECATED] + include_tasks: supervisor.yml when: not bui_use_systemd -- include_tasks: systemd.yml +- name: include systemd tasks + include_tasks: systemd.yml when: bui_use_systemd diff --git a/tasks/gunicorn.yml b/tasks/gunicorn.yml index c857c93..d90c308 100644 --- a/tasks/gunicorn.yml +++ b/tasks/gunicorn.yml @@ -6,9 +6,9 @@ gunicorn_upstart_service: True when: ansible_distribution == 'Ubuntu' and ansible_distribution_major_version|int == 14 -- name: debus see vars - debug: - msg: "distribution: {{ ansible_distribution }}, major version: {{ ansible_distribution_major_version|int }}, pip exe: {{ python_pip_executable }} " +#- name: debug see vars +# debug: +# msg: "distribution: {{ ansible_distribution }}, major version: {{ ansible_distribution_major_version|int }}, pip exe: {{ python_pip_executable }} " # gunicorn system package should not be used when using python3 - name: gunicorn | uninstall gunicorn system packages diff --git a/tasks/main.yml b/tasks/main.yml index 741d0db..4e1915a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -22,7 +22,7 @@ gunicorn_systemd_service: True when: ansible_distribution == 'Debian' and ansible_distribution_major_version|int >= 8 -- name: set gunicorn_systemd_service true for Ubuntu 16.04 and newer +- name: set gunicorn_systemd_service true for RedHat set_fact: gunicorn_systemd_service: True when: ansible_os_family == 'RedHat' @@ -30,9 +30,6 @@ - include_tasks: python3_pip.yml when: python_pip_executable == "pip3" -- include_tasks: python2_pip.yml - when: python_pip_executable == "pip2" - - name: create burp folder file: path: /etc/burp diff --git a/tasks/python2_pip.yml b/tasks/python2_pip.yml deleted file mode 100644 index 5dcc147..0000000 --- a/tasks/python2_pip.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- - -- name: pip2 | check only if burpui is installed - pip: - name: "{{ burpui_pip_burpui }}" - state: present - executable: "{{ python_pip_executable }}" - register: burpui_installed_check - check_mode: yes - -- name: pip2 | install pip packages - pip: - name: "{{ item }}" - state: present - executable: "{{ python_pip_executable }}" - with_items: "{{ burpui_pip_present }}" - -- name: pip2 | Install pip packages by version - pip: - name: "{{ item.name }}" - state: present - version: "{{ item.version}}" - executable: "{{ python_pip_executable }}" - with_items: "{{ burpui_pip_packages }}" - register: bui_pip_install - notify: restart burpui services diff --git a/tasks/python3_pip.yml b/tasks/python3_pip.yml index 910a428..786f29a 100644 --- a/tasks/python3_pip.yml +++ b/tasks/python3_pip.yml @@ -19,6 +19,14 @@ name: '{{ burpui_pip_present }}' state: present executable: "{{ python3_pip }}" + when: not burpui_use_dev + +- name: pip3 | install pip dev packages + pip: + name: '{{ burpui_pip_dev_present }}' + state: present + executable: "{{ python3_pip }}" + when: burpui_use_dev - name: pip3 | Install pip packages by version pip: @@ -36,4 +44,4 @@ register: bui_pip_install when: burpui_use_dev notify: restart burpui services - + changed_when: false diff --git a/tasks/requirements.yml b/tasks/requirements.yml index b872caa..ac8d609 100644 --- a/tasks/requirements.yml +++ b/tasks/requirements.yml @@ -7,16 +7,10 @@ cache_valid_time: 43200 changed_when: false when: ansible_os_family == 'Debian' - -- name: install required system packages - package: - name: "{{ burpui_system_requirements | join(',') }}" - state: present - when: python_pip_executable == "pip2" - name: install requirements for ansible pip package: - name: ['python-setuptools'] + name: ['python3-setuptools'] state: present - name: install burpui package requirements for python3 diff --git a/tasks/supervisor.yml b/tasks/supervisor.yml index 93ca4e8..c18753b 100644 --- a/tasks/supervisor.yml +++ b/tasks/supervisor.yml @@ -1,4 +1,5 @@ --- +# DEPRECATED - name: install Supervisor package: diff --git a/tasks/systemd.yml b/tasks/systemd.yml index 57b266f..e12d43c 100644 --- a/tasks/systemd.yml +++ b/tasks/systemd.yml @@ -24,6 +24,7 @@ name: bui-celery state: started enabled: yes + changed_when: false # redis-server systemd ubuntu - name: systemd | fix redis-server setup for systemd diff --git a/tasks/test.yml b/tasks/test.yml index 62f464c..71be6d6 100644 --- a/tasks/test.yml +++ b/tasks/test.yml @@ -3,9 +3,16 @@ # Restart services if required - meta: flush_handlers +- name: test if burpui gunircorn site about is ok + get_url: + url: http://localhost:{{ burpui_global_port }}/about + dest: /tmp/test_burpui_about_gunicorn + timeout: 30 + changed_when: false + - name: test if burpui get about is ok get_url: url: http://localhost:{{ burpui_nginx_port }}/about - dest: /tmp/test_burpui_about + dest: /tmp/test_burpui_about_nginx timeout: 30 changed_when: false diff --git a/vars/Debian.yml b/vars/Debian.yml index ddc46ce..6167668 100644 --- a/vars/Debian.yml +++ b/vars/Debian.yml @@ -6,20 +6,6 @@ burpui_system_absent: - python3-cryptography -# For python2 -burpui_system_requirements: - - python-pip - - python-setuptools - - python-dev - - libssl-dev # dependecy of ndg-httpsclient - - 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 - python3-dev @@ -37,6 +23,7 @@ burpui_py3_packages: burpui_packages: - redis-server - nginx + - locales burp_ui_celery_dependencies: - supervisor diff --git a/vars/Fedora.yml b/vars/Fedora.yml index f538876..1b4227f 100644 --- a/vars/Fedora.yml +++ b/vars/Fedora.yml @@ -6,15 +6,6 @@ burpui_system_absent: - python3-cryptography -burpui_system_requirements: - - python-pip - - python-setuptools - - python-devel - - openssl-devel # dependecy of ndg-httpsclient - - libffi-devel # dependency for cffi - - redhat-rpm-config - - gcc - burpui_packages: - redis - nginx diff --git a/vars/RedHat.yml b/vars/RedHat.yml index c7e6ab9..52b6911 100644 --- a/vars/RedHat.yml +++ b/vars/RedHat.yml @@ -6,15 +6,6 @@ burpui_system_absent: - python36-cryptography -burpui_system_requirements: - - python-pip - - python-devel - - python-setuptools - - openssl-devel # dependecy of ndg-httpsclient - - libffi-devel # dependency for cffi - - redhat-rpm-config - - gcc - burpui_packages: - redis - nginx @@ -22,12 +13,12 @@ burpui_packages: burpui_py3_packages: - python36 - python36-devel - - python36-setuptools - - python36-pip - redhat-rpm-config - openssl-devel - libffi-devel - gcc + - langpacks-en + - glibc-all-langpacks burp_ui_celery_dependencies: - supervisor diff --git a/vars/Ubuntu-14.04.yml b/vars/Ubuntu-14.04.yml deleted file mode 100644 index 2afba3f..0000000 --- a/vars/Ubuntu-14.04.yml +++ /dev/null @@ -1,41 +0,0 @@ -#:::::::::::::: -# Ubuntu-14.04.yml -#:::::::::::::: ---- - -burpui_system_absent: - - python3-cryptography - -burpui_system_requirements: - - python-pip - - python-dev - - python-setuptools - - libssl-dev # dependecy of ndg-httpsclient - - libffi-dev # dependency for cffi - - locales # required for python3 - -burpui_py3_packages: - - python3 - - python3-dev - - python3-setuptools - - python3-pip - - libssl-dev # dependecy of ndg-httpsclient - - libffi-dev # dependency for cffi - - locales # required for python3 - - gcc - -burpui_packages: - - redis-server - - nginx - -burp_ui_celery_dependencies: - - supervisor - -python3_pip: 'pip3' -supervisoretc_dir: "/etc/supervisor/conf.d" -supervisor_ext: "conf" -supervisor_service: supervisor -pip_installed_exe_bin_path: '/usr/local/bin' -redis_service: redis-server -nginx_config_dir: '/etc/nginx/sites-available' -burpui_nginx_config_path: '{{ nginx_config_dir }}/burpui'