From 206123a31ac69dea15167fc5446daf846014081c Mon Sep 17 00:00:00 2001 From: ahelal Date: Mon, 1 Mar 2021 19:46:43 +0100 Subject: [PATCH 1/5] add github action matrix --- .github/workflows/concourse.yml | 1 + .kitchen.yml | 37 +++++++++++-------------------- .travis.yml | 39 --------------------------------- defaults/main.yml | 2 +- tasks/checks.yml | 4 ++++ 5 files changed, 19 insertions(+), 64 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/concourse.yml b/.github/workflows/concourse.yml index 1194811..cb571c3 100644 --- a/.github/workflows/concourse.yml +++ b/.github/workflows/concourse.yml @@ -14,6 +14,7 @@ jobs: matrix: ruby-version: ['3.0'] ansible-version: ['2.8.17', '2.9.17', '2.10.3'] + concourseci_version: ['v7.0.0', 'v6.7.5'] steps: - uses: actions/checkout@v2 diff --git a/.kitchen.yml b/.kitchen.yml index ae81b56..8636e61 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -25,21 +25,10 @@ provisioner : diff : True sudo : True extra_vars : "@./test/integration/simple/concourse-vars.yml" + raw_arguments : "-e concourseci_version=<%= ENV['concourseci_version'] || 'v7.0.0' %>" # verbose : "vvvvv" platforms : -### Ubuntu 1604 - - name : "ubuntu1604" - driver_config : - image : ubuntu:16.04 - platform : ubuntu - provisioner : - groups : - concourse-web : - - 'simple-ubuntu1604' - concourse-worker : - - 'simple-ubuntu1604' - - 'worker-ubuntu1604' ### Ubuntu 1804 - name : "ubuntu1804" driver_config : @@ -52,18 +41,18 @@ platforms : concourse-worker : - 'simple-ubuntu1804' - 'worker-ubuntu1804' -### Ubuntu 2004 -# - name : "ubuntu2004" -# driver_config : -# image : ubuntu:20.04 -# platform : ubuntu -# provisioner : -# groups : -# concourse-web : -# - 'simple-ubuntu2004' -# concourse-worker : -# - 'simple-ubuntu2004' - # - 'worker-ubuntu2004' +## Ubuntu 2004 + - name : "ubuntu2004" + driver_config : + image : ubuntu:20.04 + platform : ubuntu + provisioner : + groups : + concourse-web : + - 'simple-ubuntu2004' + concourse-worker : + - 'simple-ubuntu2004' + - 'worker-ubuntu2004' suites: - name : simple provisioner : diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 57ff81a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,39 +0,0 @@ ---- -language: python -python: "2.7" -dist: trusty -sudo: required -services: - - docker - -env: - - TEST_COMMAND="bundle exec kitchen test simple-ubuntu1404-one" - - TEST_COMMAND="bundle exec kitchen test simple-ubuntu1404-three" - - - TEST_COMMAND="bundle exec kitchen test simple-ubuntu1604-one" - - TEST_COMMAND="bundle exec kitchen test simple-ubuntu1604-two" - - TEST_COMMAND="bundle exec kitchen test simple-ubuntu1604-three" - - - TEST_COMMAND="bundle exec kitchen test simple-ubuntu1804-one" - - TEST_COMMAND="bundle exec kitchen test simple-ubuntu1804-three" - - - TEST_COMMAND="./test/test-cluster.sh" - -before_install: - # Make sure everything's up to date. - - sudo apt-get update -qq - - sudo apt-get install -qq python-apt python-pycurl git python-pip ruby ruby-dev build-essential autoconf - - gem install bundler - -install: - - sudo locale-gen en_US.UTF-8 - - sudo dpkg-reconfigure locales - - bash ./test/ansible-setup.sh - - bash ./test/setup_roles.sh - - bundle install - -script: - - LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 $TEST_COMMAND - -after_success: - - echo "Success" diff --git a/defaults/main.yml b/defaults/main.yml index 6e637ac..c230d81 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,6 @@ --- # Concourse version -concourseci_version : "v5.4.0" +concourseci_version : "v7.0.0" ## Dir structure concourseci_base_dir : "/opt/concourseci" concourseci_bin_dir : "{{ concourseci_base_dir }}/bin" diff --git a/tasks/checks.yml b/tasks/checks.yml index 0d53fe4..dfc2627 100644 --- a/tasks/checks.yml +++ b/tasks/checks.yml @@ -10,6 +10,10 @@ msg: "Configuration for this role has changed. Please read the Readme.md" when: CONCOURSE_WEB_BIND_IP is defined or CONCOURSE_WEB_TSA_HOST is defined +- name: checks | Display version + ansible.builtin.debug: + msg: "Target version {{concourseci_version}}" + - name: checks | Set downloaded url for concourse version 4.x or lower set_fact: concourseci_download_url: "{{ concourseci_download_fr_url }}/{{ version_4_filename }}" From 49661473cb66b6c584f471b28c35869254b18bca Mon Sep 17 00:00:00 2001 From: ahelal Date: Mon, 1 Mar 2021 19:56:43 +0100 Subject: [PATCH 2/5] upgrade pip3 --- .github/workflows/concourse.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/concourse.yml b/.github/workflows/concourse.yml index cb571c3..f102bed 100644 --- a/.github/workflows/concourse.yml +++ b/.github/workflows/concourse.yml @@ -31,6 +31,7 @@ jobs: - name: Setup ansible run: | sudo apt-get install -y python3-setuptools + pip3 -m pip install --upgrade pip pip3 install ansible==${{matrix.ansible-version}} export PATH=/home/runner/.local/bin:$PATH From 8c9bba68e8127f9805dc6fbaaefaa41d2b649fbd Mon Sep 17 00:00:00 2001 From: ahelal Date: Mon, 1 Mar 2021 19:58:41 +0100 Subject: [PATCH 3/5] fix upgrade --- .github/workflows/concourse.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/concourse.yml b/.github/workflows/concourse.yml index f102bed..dfcfe2d 100644 --- a/.github/workflows/concourse.yml +++ b/.github/workflows/concourse.yml @@ -31,7 +31,7 @@ jobs: - name: Setup ansible run: | sudo apt-get install -y python3-setuptools - pip3 -m pip install --upgrade pip + pip3 install --upgrade pip pip3 install ansible==${{matrix.ansible-version}} export PATH=/home/runner/.local/bin:$PATH From a407e02a782919bcc6f5f3e5fb27b7aac419022f Mon Sep 17 00:00:00 2001 From: ahelal Date: Mon, 1 Mar 2021 20:52:40 +0100 Subject: [PATCH 4/5] support ubuntu3 and python3 --- .kitchen-cluster.yml | 2 +- .kitchen.yml | 2 +- tasks/auth.yml | 8 ++++---- test/helper_roles/roles_requirements.yml | 2 +- test/integration/simple/simple.yml | 9 ++++++--- vars/main.yml | 4 ++++ 6 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.kitchen-cluster.yml b/.kitchen-cluster.yml index e9e174c..23a24ca 100644 --- a/.kitchen-cluster.yml +++ b/.kitchen-cluster.yml @@ -20,7 +20,7 @@ provisioner : name : ansible_push ansible_config : "tests/ansible.cfg" extra_vars : "@./test/integration/simple/concourse-vars.yml" - raw_arguments : "--extra-vars='ansible_python_interpreter=/usr/bin/python3'" + raw_arguments : "-e concourseci_version=<%= ENV['concourseci_version'] || 'v7.0.0' %> --extra-vars='ansible_python_interpreter=/usr/bin/python3'" groups : concourse-web : ['web-ubuntu1804'] diff --git a/.kitchen.yml b/.kitchen.yml index 8636e61..45bd338 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -25,7 +25,7 @@ provisioner : diff : True sudo : True extra_vars : "@./test/integration/simple/concourse-vars.yml" - raw_arguments : "-e concourseci_version=<%= ENV['concourseci_version'] || 'v7.0.0' %>" + raw_arguments : "-e concourseci_version=<%= ENV['concourseci_version'] || 'v7.0.0' %> --extra-vars='ansible_python_interpreter=/usr/bin/python3'" # verbose : "vvvvv" platforms : diff --git a/tasks/auth.yml b/tasks/auth.yml index ff4b706..511af46 100644 --- a/tasks/auth.yml +++ b/tasks/auth.yml @@ -2,13 +2,13 @@ - name: auth | Install httpasswd apt: - name: "python-passlib,python-bcrypt" + name: "python3-passlib,python3-bcrypt" #"{{ passlib_apt_dependencies }}" state: "present" - when: ansible_os_family == 'Debian' + when: ansible_os_family == 'Debian' - name: auth | Check that one local user is added fail: - msg="At least one local user is needed" + msg: "At least one local user is needed" when: concourse_local_users | length == 0 - name: auth | Create bcrypt password for local users @@ -31,7 +31,7 @@ - name: auth | Add concourse_add_local_user set_fact: concourse_facts_local_users: - CONCOURSE_ADD_LOCAL_USER: "{{ list_users.stdout_lines | join(',') }}" + CONCOURSE_ADD_LOCAL_USER : "{{ list_users.stdout_lines | join(',') }}" - name: auth | Set empty dict concourse_facts_main_users set_fact: diff --git a/test/helper_roles/roles_requirements.yml b/test/helper_roles/roles_requirements.yml index 4e2e5f0..0bb7d5b 100644 --- a/test/helper_roles/roles_requirements.yml +++ b/test/helper_roles/roles_requirements.yml @@ -2,4 +2,4 @@ - name: postgresql src: git+https://github.com/ANXS/postgresql.git - version: v1.9.0 + version: v1.12.0 diff --git a/test/integration/simple/simple.yml b/test/integration/simple/simple.yml index 09d64db..08e6a4f 100644 --- a/test/integration/simple/simple.yml +++ b/test/integration/simple/simple.yml @@ -5,11 +5,11 @@ gather_facts: False become: True tasks: - - name: install python 2 - raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal) + - name: install python 3 + raw: test -e /usr/bin/python3 || (apt -y update && apt install -y python3-minimal) changed_when: False -- name: Install iproute2 +- name: Install dep hosts: all gather_facts: False become: True @@ -17,6 +17,9 @@ - name: install iproute 2 apt: name: iproute2 + - name: install gnupg + apt: + name: gnupg - name: Provision Concourse hosts: all diff --git a/vars/main.yml b/vars/main.yml index 22a674f..78f693a 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -22,6 +22,10 @@ concourseci_download_fr_url : "https://github.com/concourse/concourse/releases/ concourseci_worker_position : "{{ groups[concourseci_worker_group].index(inventory_hostname)| default(0) }}" +passlib_apt_py3_dependencies: "python3-passlib,python3-bcrypt" +passlib_apt_py2_dependencies: python-passlib,python-bcrypt +passlib_apt_dependencies: "{{ passlib_apt_py3_dependencies if 'python3' in ansible_python_interpreter | default('') else passlib_apt_py2_dependencies }}" + ## MacOSx stuff concourseci_launchd_path : "/Library/LaunchDaemons" concourseci_launchd_web : "com.github.ahelal.concourse.web" From c74ac572a9ca314ed7a17f3d78b68479ffa8d8c7 Mon Sep 17 00:00:00 2001 From: ahelal Date: Mon, 1 Mar 2021 21:17:28 +0100 Subject: [PATCH 5/5] remove 20.04 for now --- .kitchen.yml | 24 ++++++++++++------------ tasks/auth.yml | 1 - 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.kitchen.yml b/.kitchen.yml index 45bd338..20960ba 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -41,18 +41,18 @@ platforms : concourse-worker : - 'simple-ubuntu1804' - 'worker-ubuntu1804' -## Ubuntu 2004 - - name : "ubuntu2004" - driver_config : - image : ubuntu:20.04 - platform : ubuntu - provisioner : - groups : - concourse-web : - - 'simple-ubuntu2004' - concourse-worker : - - 'simple-ubuntu2004' - - 'worker-ubuntu2004' +# ## Ubuntu 2004 +# - name : "ubuntu2004" +# driver_config : +# image : ubuntu:20.04 +# platform : ubuntu +# provisioner : +# groups : +# concourse-web : +# - 'simple-ubuntu2004' +# concourse-worker : +# - 'simple-ubuntu2004' +# - 'worker-ubuntu2004' suites: - name : simple provisioner : diff --git a/tasks/auth.yml b/tasks/auth.yml index 511af46..b3312e2 100644 --- a/tasks/auth.yml +++ b/tasks/auth.yml @@ -42,4 +42,3 @@ concourse_facts_main_users: CONCOURSE_MAIN_TEAM_LOCAL_USER: "{% for local_user in concourse_local_users %}{{local_user.user}}{% if not loop.last %},{% endif %}{% endfor %}" when: concourse_web_options['CONCOURSE_MAIN_TEAM_LOCAL_USER'] is not defined -