From b5302aa64594150c3d390c8be24a474db05f7826 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Mon, 19 Jan 2026 08:38:45 +0530 Subject: [PATCH 01/59] * Added required prefix to kpm_yml variable. * Declared new variables to all.yml. --- ansible/group_vars/all.yml | 2 ++ ansible/roles/kaui/tasks/main.yml | 2 +- ansible/roles/killbill/tasks/main.yml | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 1eaeccb4..d30c252f 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -28,6 +28,8 @@ kb_config_dir: "{{ kb_install_dir }}/config" kb_plugins_dir: "{{ kb_install_dir }}/bundles" # kpm.yml file kpm_yml: "{{ kb_install_dir }}/kpm.yml" +killbill_kpm_yml: "{{ kb_install_dir }}/kpm.yml" +kaui_kpm_yml: "{{ kb_install_dir }}/kpm.yml" kaui_install_dir: /var/lib/kaui # For consistency as to where the sha1.yml is located diff --git a/ansible/roles/kaui/tasks/main.yml b/ansible/roles/kaui/tasks/main.yml index 13c47b65..c3675fd5 100644 --- a/ansible/roles/kaui/tasks/main.yml +++ b/ansible/roles/kaui/tasks/main.yml @@ -53,7 +53,7 @@ become_user: "{{ tomcat_owner }}" killbill: kpm_path: "{{ kpm_path }}" - kpm_yml: "{{ kpm_yml }}" + kpm_yml: "{{ kaui_kpm_yml }}" when: not existing_webapp.stat.exists tags: kpm-install diff --git a/ansible/roles/killbill/tasks/main.yml b/ansible/roles/killbill/tasks/main.yml index 23158eec..522ba969 100644 --- a/ansible/roles/killbill/tasks/main.yml +++ b/ansible/roles/killbill/tasks/main.yml @@ -68,7 +68,7 @@ become_user: "{{ tomcat_owner }}" killbill: kpm_path: "{{ kpm_path }}" - kpm_yml: "{{ kpm_yml }}" + kpm_yml: "{{ killbill_kpm_yml }}" when: not existing_webapp.stat.exists tags: kpm-install From dfdbcb12adc5be30369ab0b784c4e5a363b06890 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Mon, 19 Jan 2026 20:55:12 +0530 Subject: [PATCH 02/59] Fixed ansible_lint workflow --- .github/workflows/ansible_lint.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ansible_lint.yml b/.github/workflows/ansible_lint.yml index 8c295695..44da1845 100644 --- a/.github/workflows/ansible_lint.yml +++ b/.github/workflows/ansible_lint.yml @@ -9,10 +9,9 @@ jobs: ansible_lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Lint Ansible Playbook - # TODO There's work to upgrade to 6.x - uses: ansible/ansible-lint-action@2878af4748adf988a42b3ad88a94051dba635fba + uses: ansible/ansible-lint@v25.9.2 with: # FIXME # Globbing is broken at the moment: @@ -32,7 +31,3 @@ jobs: ansible/tomcat_restart.yml ansible/tomcat_stop.yml args: "-x 204" - override-deps: | - ansible==2.10.7 - ansible-base==2.10.5 - ansible-lint==5.3.2 From a876b5b55fb1815c694696206600937da134b0c8 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Mon, 19 Jan 2026 21:08:46 +0530 Subject: [PATCH 03/59] Skipped role name --- .github/workflows/ansible_lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ansible_lint.yml b/.github/workflows/ansible_lint.yml index 44da1845..91b53472 100644 --- a/.github/workflows/ansible_lint.yml +++ b/.github/workflows/ansible_lint.yml @@ -30,4 +30,4 @@ jobs: ansible/tomcat.yml ansible/tomcat_restart.yml ansible/tomcat_stop.yml - args: "-x 204" + args: "-x 204,role-name" From 92b7c9b0acbe70cb0f9420d971f33dc6f857b492 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Mon, 19 Jan 2026 21:28:47 +0530 Subject: [PATCH 04/59] Fixed lint error -- All names should start with an uppercase letter. --- .github/workflows/ansible_lint.yml | 2 +- ansible/diagnostic.yml | 12 ++++++------ ansible/roles/tomcat/tasks/install.yml | 18 +++++++++--------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ansible_lint.yml b/.github/workflows/ansible_lint.yml index 91b53472..7dfed6f7 100644 --- a/.github/workflows/ansible_lint.yml +++ b/.github/workflows/ansible_lint.yml @@ -30,4 +30,4 @@ jobs: ansible/tomcat.yml ansible/tomcat_restart.yml ansible/tomcat_stop.yml - args: "-x 204,role-name" + args: "-x 204,role-name --skip-list yaml[line-length],role-name[path]" diff --git a/ansible/diagnostic.yml b/ansible/diagnostic.yml index 5e598cf8..33cf8747 100644 --- a/ansible/diagnostic.yml +++ b/ansible/diagnostic.yml @@ -9,13 +9,13 @@ - name: gather diagnostics killbill_diagnostics: kpm_path: "{{ kpm_path }}" - killbill_url: "{{ killbill_url|default('http://127.0.0.1:8080') }}" + killbill_url: "{{ killbill_url | default('http://127.0.0.1:8080') }}" killbill_web_path: "{{ catalina_base }}/{{ kb_webapps }}/ROOT.war" - killbill_user: "{{ killbill_user|default('admin') }}" - killbill_password: "{{ killbill_password|default('password') }}" - killbill_api_key: "{{ killbill_api_key|default('bob') }}" - killbill_api_secret: "{{ killbill_api_secret|default('lazar') }}" - killbill_account: "{{ killbill_account|default('') }}" + killbill_user: "{{ killbill_user | default('admin') }}" + killbill_password: "{{ killbill_password | default('password') }}" + killbill_api_key: "{{ killbill_api_key | default('bob') }}" + killbill_api_secret: "{{ killbill_api_secret | default('lazar') }}" + killbill_account: "{{ killbill_account | default('') }}" bundles_dir: "{{ kb_plugins_dir }}" log_dir: "{{ catalina_base }}/logs" tags: diagnostics \ No newline at end of file diff --git a/ansible/roles/tomcat/tasks/install.yml b/ansible/roles/tomcat/tasks/install.yml index 0d588fca..6abc4f82 100644 --- a/ansible/roles/tomcat/tasks/install.yml +++ b/ansible/roles/tomcat/tasks/install.yml @@ -1,5 +1,5 @@ --- -- name: ensure Tomcat install dir exists +- name: Ensure Tomcat install dir exists become: true file: path: "{{ tomcat_install_dir }}" @@ -7,7 +7,7 @@ mode: u=rwx,g=rx,o=rx tags: install -- name: add Tomcat group +- name: Add Tomcat group become: true group: name: "{{ tomcat_group }}" @@ -15,7 +15,7 @@ tags: install # Expect bash to be present -- we haven't tested the scripts with other shells -- name: add Tomcat user +- name: Add Tomcat user become: true user: name: "{{ tomcat_owner }}" @@ -27,7 +27,7 @@ state: present tags: install -- name: download Tomcat release metadata +- name: Download Tomcat release metadata uri: url: "{{ nexus_url }}/{{ nexus_repository }}/org/apache/tomcat/tomcat/maven-metadata.xml" return_content: yes @@ -36,13 +36,13 @@ tags: install # We don't use the xml module to avoid a dependency on lxml -- name: set tomcat_version +- name: Set tomcat_version set_fact: tomcat_version: "{{ tomcat_metadata.content | regex_findall('(9.0.*)', '\\1') | last }}" when: tomcat_version is undefined tags: install -- name: install Tomcat +- name: Install Tomcat become: true unarchive: src: "http://archive.apache.org/dist/tomcat/tomcat-9/v{{ tomcat_version }}/bin/apache-tomcat-{{ tomcat_version }}.tar.gz" @@ -53,17 +53,17 @@ tags: install # The individual files have the correct permissions already, but not the top directory -- name: set correct permissions +- name: Set correct permissions become: true file: path="{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" owner={{ tomcat_owner }} group={{ tomcat_group }} recurse=yes tags: install -- name: symlink install directory +- name: Symlink install directory become: true file: src="{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" path="{{ catalina_home }}" state=link tags: install -- name: set required Tomcat environment variables +- name: Set required Tomcat environment variables become: true become_user: "{{ tomcat_owner }}" lineinfile: From e4ae4c9b85edc1197e59f574305e672144cfa067 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Mon, 19 Jan 2026 22:08:53 +0530 Subject: [PATCH 05/59] Fixed lint errors --- .github/workflows/ansible_lint.yml | 18 +------- ansible/README.md | 2 +- ansible/diagnostic.yml | 4 +- ansible/flyway.yml | 4 +- ansible/java.yml | 2 +- ansible/kaui.yml | 6 +-- ansible/kaui_json_logging.yml | 4 +- ansible/killbill.yml | 6 +-- ansible/killbill_json_logging.yml | 2 +- ansible/kpm.yml | 2 +- ansible/roles/common/tasks/main.yml | 4 +- ansible/roles/kaui/tasks/json_logging.yml | 15 ++++--- ansible/roles/kaui/tasks/main.yml | 31 ++++++++----- ansible/roles/killbill/tasks/main.yml | 33 +++++++++----- ansible/roles/kpm/tasks/main.yml | 49 ++++++++++++--------- ansible/roles/migrations/tasks/flyway.yml | 26 ++++++----- ansible/roles/migrations/tasks/main.yml | 6 +-- ansible/roles/migrations/tasks/migrate.yml | 14 +++--- ansible/roles/tomcat/tasks/install.yml | 17 ++++--- ansible/roles/tomcat/tasks/java.yml | 6 +-- ansible/roles/tomcat/tasks/json_logging.yml | 15 ++++--- ansible/roles/tomcat/tasks/main.yml | 11 +++-- ansible/roles/tomcat/tasks/native.yml | 44 +++++++++--------- ansible/roles/tomcat/tasks/restart.yml | 4 +- ansible/roles/tomcat/tasks/stop.yml | 14 +++--- ansible/tomcat.yml | 6 +-- ansible/tomcat_restart.yml | 2 +- ansible/tomcat_stop.yml | 2 +- 28 files changed, 194 insertions(+), 155 deletions(-) diff --git a/.github/workflows/ansible_lint.yml b/.github/workflows/ansible_lint.yml index 7dfed6f7..df6fc3cc 100644 --- a/.github/workflows/ansible_lint.yml +++ b/.github/workflows/ansible_lint.yml @@ -13,21 +13,5 @@ jobs: - name: Lint Ansible Playbook uses: ansible/ansible-lint@v25.9.2 with: - # FIXME - # Globbing is broken at the moment: - # https://github.com/ansible/ansible-lint-action/issues/30 - #targets: "ansible/*.{yaml,yml}" - targets: | - ansible/diagnostic.yml - ansible/flyway.yml - ansible/kaui.yml - ansible/kaui_json_logging.yml - ansible/killbill.yml - ansible/killbill_json_logging.yml - ansible/kpm.yml - ansible/migrations.yml - ansible/plugin.yml - ansible/tomcat.yml - ansible/tomcat_restart.yml - ansible/tomcat_stop.yml + working_directory: ami/ansible/ args: "-x 204,role-name --skip-list yaml[line-length],role-name[path]" diff --git a/ansible/README.md b/ansible/README.md index a7825830..339eba34 100644 --- a/ansible/README.md +++ b/ansible/README.md @@ -153,7 +153,7 @@ To build upon these roles, you can create your own play, e.g.: include_role: name: killbill-cloud/ansible/roles/killbill - name: customize Kill Bill - import_tasks: roles/acme/tasks/main.yml + ansible.builtin.import_tasks: roles/acme/tasks/main.yml ``` Note that you need to have your own templates directory, containing your own templates. diff --git a/ansible/diagnostic.yml b/ansible/diagnostic.yml index 33cf8747..7c4de892 100644 --- a/ansible/diagnostic.yml +++ b/ansible/diagnostic.yml @@ -3,9 +3,9 @@ hosts: all tasks: - name: setup Ruby - import_tasks: roles/common/tasks/main.yml + ansible.builtin.import_tasks: roles/common/tasks/main.yml - name: setup KPM - import_tasks: roles/kpm/tasks/main.yml + ansible.builtin.import_tasks: roles/kpm/tasks/main.yml - name: gather diagnostics killbill_diagnostics: kpm_path: "{{ kpm_path }}" diff --git a/ansible/flyway.yml b/ansible/flyway.yml index bbeed601..97cf266b 100644 --- a/ansible/flyway.yml +++ b/ansible/flyway.yml @@ -3,6 +3,6 @@ hosts: all tasks: - name: setup Ruby - import_tasks: roles/common/tasks/main.yml + ansible.builtin.import_tasks: roles/common/tasks/main.yml - name: install Flyway - import_tasks: roles/migrations/tasks/flyway.yml + ansible.builtin.import_tasks: roles/migrations/tasks/flyway.yml diff --git a/ansible/java.yml b/ansible/java.yml index 68207705..9b257879 100644 --- a/ansible/java.yml +++ b/ansible/java.yml @@ -7,4 +7,4 @@ java_home: /usr/lib/jvm/default-java tasks: - name: install Java - import_tasks: roles/tomcat/tasks/java.yml + ansible.builtin.import_tasks: roles/tomcat/tasks/java.yml diff --git a/ansible/kaui.yml b/ansible/kaui.yml index 2da45864..9286a45d 100644 --- a/ansible/kaui.yml +++ b/ansible/kaui.yml @@ -5,8 +5,8 @@ kpm_yml: /var/lib/kaui/kpm.yml tasks: - name: setup Ruby - import_tasks: roles/common/tasks/main.yml + ansible.builtin.import_tasks: roles/common/tasks/main.yml - name: setup Tomcat - import_tasks: roles/tomcat/tasks/main.yml + ansible.builtin.import_tasks: roles/tomcat/tasks/main.yml - name: install Kaui - import_tasks: roles/kaui/tasks/main.yml + ansible.builtin.import_tasks: roles/kaui/tasks/main.yml diff --git a/ansible/kaui_json_logging.yml b/ansible/kaui_json_logging.yml index ae14fb49..d15ec6cc 100644 --- a/ansible/kaui_json_logging.yml +++ b/ansible/kaui_json_logging.yml @@ -3,6 +3,6 @@ hosts: all tasks: - name: download third-party dependencies - import_tasks: roles/kaui/tasks/json_logging.yml + ansible.builtin.import_tasks: roles/kaui/tasks/json_logging.yml - name: enable Tomcat JSON logging - import_tasks: roles/tomcat/tasks/json_logging.yml + ansible.builtin.import_tasks: roles/tomcat/tasks/json_logging.yml diff --git a/ansible/killbill.yml b/ansible/killbill.yml index 5999721b..06de6caf 100644 --- a/ansible/killbill.yml +++ b/ansible/killbill.yml @@ -3,8 +3,8 @@ hosts: all tasks: - name: setup Ruby - import_tasks: roles/common/tasks/main.yml + ansible.builtin.import_tasks: roles/common/tasks/main.yml - name: setup Tomcat - import_tasks: roles/tomcat/tasks/main.yml + ansible.builtin.import_tasks: roles/tomcat/tasks/main.yml - name: install Kill Bill - import_tasks: roles/killbill/tasks/main.yml + ansible.builtin.import_tasks: roles/killbill/tasks/main.yml diff --git a/ansible/killbill_json_logging.yml b/ansible/killbill_json_logging.yml index 03e7075f..b3283180 100644 --- a/ansible/killbill_json_logging.yml +++ b/ansible/killbill_json_logging.yml @@ -3,4 +3,4 @@ hosts: all tasks: - name: enable Tomcat JSON logging - import_tasks: roles/tomcat/tasks/json_logging.yml + ansible.builtin.import_tasks: roles/tomcat/tasks/json_logging.yml diff --git a/ansible/kpm.yml b/ansible/kpm.yml index 755e5522..13877f95 100644 --- a/ansible/kpm.yml +++ b/ansible/kpm.yml @@ -3,4 +3,4 @@ hosts: all tasks: - name: install KPM - import_tasks: roles/kpm/tasks/main.yml + ansible.builtin.import_tasks: roles/kpm/tasks/main.yml diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml index 2f92b483..42cc364f 100644 --- a/ansible/roles/common/tasks/main.yml +++ b/ansible/roles/common/tasks/main.yml @@ -1,4 +1,4 @@ --- -- name: ansible_ruby_interpreter setup - set_fact: ansible_ruby_interpreter="{{ kpm_path }}/lib/ruby/bin/ruby" +- name: Ansible_ruby_interpreter setup + ansible.builtin.set_fact: ansible_ruby_interpreter="{{ kpm_path }}/lib/ruby/bin/ruby" tags: common diff --git a/ansible/roles/kaui/tasks/json_logging.yml b/ansible/roles/kaui/tasks/json_logging.yml index 0d245777..fbe427d3 100644 --- a/ansible/roles/kaui/tasks/json_logging.yml +++ b/ansible/roles/kaui/tasks/json_logging.yml @@ -1,7 +1,7 @@ --- -- name: download Logstash third-party dependencies +- name: Download Logstash third-party dependencies become: true - get_url: + ansible.builtin.get_url: url: "{{ nexus_url }}/{{ nexus_repository }}/{{ item.group_path }}/{{ item.artifact_id }}/{{ item.version }}/{{ item.artifact_id }}-{{ item.version }}.jar" dest: "{{ item.dest }}" with_items: @@ -22,9 +22,12 @@ - logstash - download -- name: set correct permissions +- name: Set correct permissions become: true - file: path=/opt/{{ item.name }} owner={{ tomcat_owner }} group={{ tomcat_group }} + ansible.builtin.file: + path=/opt/{{ item.name }} + owner={{ tomcat_owner }} + group={{ tomcat_group }} with_items: - name: jackson-databind.jar - name: jackson-core.jar @@ -33,8 +36,8 @@ - kaui-logback - logstash -- name: ensure Logstash third-party dependencies exist in the webapp - copy: +- name: Ensure Logstash third-party dependencies exist in the webapp + ansible.builtin.copy: src: "/opt/{{ item.name }}" dest: "{{ catalina_base }}/webapps/ROOT/WEB-INF/lib/{{ item.name }}" owner: "{{ tomcat_owner }}" diff --git a/ansible/roles/kaui/tasks/main.yml b/ansible/roles/kaui/tasks/main.yml index c3675fd5..c44abf84 100644 --- a/ansible/roles/kaui/tasks/main.yml +++ b/ansible/roles/kaui/tasks/main.yml @@ -1,13 +1,18 @@ --- -- name: ensure Kaui dirs exist +- name: Ensure Kaui dirs exist become: true - file: path={{ item }} state=directory owner={{ tomcat_owner }} group={{ tomcat_group }} mode=u=rwx,g=rx,o=rx + ansible.builtin.file: + path={{ item }} + state=directory + owner={{ tomcat_owner }} + group={{ tomcat_group }} + mode=u=rwx,g=rx,o=rx with_items: - "{{ kaui_install_dir }}" - "{{ kaui_plugins_dir }}" tags: kpm-install -- name: generate kpm.yml file if needed +- name: Generate kpm.yml file if needed become: true template: src: "kaui/kpm.yml.j2" @@ -20,7 +25,7 @@ tags: kpm-install # Generate Kaui-specific Tomcat configuration files based on environment variables -- name: generate Tomcat files +- name: Generate Tomcat files become: true template: src: "{{ item.src }}/{{ item.name }}.j2" @@ -37,7 +42,7 @@ dest: "{{ catalina_base }}/bin" tags: tomcat -- name: check if a ROOT webapp is already installed +- name: Check if a ROOT webapp is already installed stat: path: "{{ catalina_base }}/{{ kaui_webapps }}/ROOT" register: existing_webapp @@ -48,7 +53,7 @@ # and always download the war. # In practice, this means one cannot just update the version in the kpm.yml file # to update Kaui and re-run the role: one needs to first delete the ROOT directory. -- name: run KPM install +- name: Run KPM install become: true become_user: "{{ tomcat_owner }}" killbill: @@ -57,14 +62,18 @@ when: not existing_webapp.stat.exists tags: kpm-install -- name: set correct permissions +- name: Set correct permissions become: true - file: path={{ kaui_install_dir }} owner={{ tomcat_owner }} group={{ tomcat_group }} recurse=yes + ansible.builtin.file: + path={{ kaui_install_dir }} + owner={{ tomcat_owner }} + group={{ tomcat_group }} + recurse=yes tags: kpm-install - name: Create ROOT directory to unarchive the WAR become: true - file: + ansible.builtin.file: path: "{{ catalina_base }}/{{ kaui_webapps }}/ROOT" state: directory mode: '0755' @@ -96,7 +105,7 @@ - name: Recursively change ownership for the expanded ROOT become: true - file: + ansible.builtin.file: path: "{{ catalina_base }}/{{ kaui_webapps }}/ROOT" state: directory recurse: yes @@ -107,7 +116,7 @@ - name: Remove root archive become: true - file: + ansible.builtin.file: path: "{{ catalina_base }}/{{ kaui_webapps }}/ROOT.war" state: absent tags: kaui-logback diff --git a/ansible/roles/killbill/tasks/main.yml b/ansible/roles/killbill/tasks/main.yml index 522ba969..34f635e2 100644 --- a/ansible/roles/killbill/tasks/main.yml +++ b/ansible/roles/killbill/tasks/main.yml @@ -1,14 +1,19 @@ --- -- name: ensure Kill Bill dirs exist +- name: Ensure Kill Bill dirs exist become: true - file: path={{ item }} state=directory owner={{ tomcat_owner }} group={{ tomcat_group }} mode=u=rwx,g=rx,o=rx + ansible.builtin.file: + path={{ item }} + state=directory + owner={{ tomcat_owner }} + group={{ tomcat_group }} + mode=u=rwx,g=rx,o=rx with_items: - "{{ kb_config_dir }}" - "{{ kb_plugins_dir }}" tags: kpm-install # Generate Kill Bill placeholder configuration files -- name: generate Kill Bill files +- name: Generate Kill Bill files become: true template: src: "killbill/{{ item.name }}.j2" @@ -22,7 +27,7 @@ - name: killbill.properties tags: kpm-install -- name: generate kpm.yml file if needed +- name: Generate kpm.yml file if needed become: true template: src: "killbill/kpm.yml.j2" @@ -35,7 +40,7 @@ tags: kpm-install # Generate Kill Bill-specific Tomcat configuration files based on environment variables -- name: generate Tomcat files +- name: Generate Tomcat files become: true template: src: "{{ item.src }}/{{ item.name }}.j2" @@ -52,7 +57,7 @@ dest: "{{ catalina_base }}/bin" tags: tomcat -- name: check if a ROOT webapp is already installed +- name: Check if a ROOT webapp is already installed stat: path: "{{ catalina_base }}/{{ kb_webapps }}/ROOT" register: existing_webapp @@ -63,7 +68,7 @@ # and always download the war. # In practice, this means one cannot just update the version in the kpm.yml file # to update Kill Bill and re-run the role: one needs to first delete the ROOT directory. -- name: run KPM install +- name: Run KPM install become: true become_user: "{{ tomcat_owner }}" killbill: @@ -72,14 +77,18 @@ when: not existing_webapp.stat.exists tags: kpm-install -- name: set correct permissions +- name: Set correct permissions become: true - file: path={{ kb_install_dir }} owner={{ tomcat_owner }} group={{ tomcat_group }} recurse=yes + ansible.builtin.file: + path={{ kb_install_dir }} + owner={{ tomcat_owner }} + group={{ tomcat_group }} + recurse=yes tags: kpm-install - name: Create ROOT directory to unarchive the WAR become: true - file: + ansible.builtin.file: path: "{{ catalina_base }}/{{ kb_webapps }}/ROOT" state: directory mode: '0755' @@ -111,7 +120,7 @@ - name: Recursively change ownership for the expanded ROOT become: true - file: + ansible.builtin.file: path: "{{ catalina_base }}/{{ kb_webapps }}/ROOT" state: directory recurse: yes @@ -122,7 +131,7 @@ - name: Remove root archive become: true - file: + ansible.builtin.file: path: "{{ catalina_base }}/{{ kb_webapps }}/ROOT.war" state: absent tags: killbill-logback diff --git a/ansible/roles/kpm/tasks/main.yml b/ansible/roles/kpm/tasks/main.yml index e7b775e0..642673f3 100644 --- a/ansible/roles/kpm/tasks/main.yml +++ b/ansible/roles/kpm/tasks/main.yml @@ -1,13 +1,13 @@ --- -- name: ensure KPM install dir exists +- name: Ensure KPM install dir exists become: true - file: + ansible.builtin.file: path: "{{ kpm_install_dir }}" state: directory mode: u=rwx,g=rx,o=rx tags: kpm -- name: download kpm release metadata +- name: Download kpm release metadata uri: url: "{{ nexus_url }}/{{ nexus_repository }}/org/kill-bill/billing/installer/kpm/maven-metadata.xml" return_content: yes @@ -16,20 +16,20 @@ tags: kpm # We don't use the xml module to avoid a dependency on lxml -- name: set kpm_version - set_fact: +- name: Set kpm_version + ansible.builtin.set_fact: # maven-metadata.xml is often confusing (wrong?) w.r.t. how and elements are populated. Just pick the last entry of kpm_version: "{{ kpm_metadata.content | regex_findall('(.*)') | last }}" when: kpm_version is undefined tags: kpm -- name: check if KPM is already installed +- name: Check if KPM is already installed stat: path: "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}/kpm" register: kpm_bin tags: kpm -- name: check if pre-built KPM exists for this arch +- name: Check if pre-built KPM exists for this arch uri: url: "{{ nexus_url }}/{{ nexus_repository }}/org/kill-bill/billing/installer/kpm/{{ kpm_version }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}.tar.gz" method: HEAD @@ -38,9 +38,9 @@ when: not kpm_bin.stat.exists tags: kpm -- name: download noarch KPM +- name: Download noarch KPM become: true - get_url: + ansible.builtin.get_url: # Use the redirect API to support SNAPSHOT url: "{{ nexus_url }}/{{ nexus_repository }}/org/kill-bill/billing/installer/kpm/{{ kpm_version }}/kpm-{{ kpm_version }}-noarch.tar.gz" dest: "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-noarch.tar.gz" @@ -49,9 +49,9 @@ when: not kpm_bin.stat.exists and kpm_arch_test.status >= 400 tags: kpm -- name: install noarch KPM +- name: Install noarch KPM become: true - unarchive: + ansible.builtin.unarchive: src: "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-noarch.tar.gz" remote_src: True dest: "{{ kpm_install_dir }}" @@ -61,15 +61,15 @@ tags: kpm # To make things easier -- name: rename noarch KPM directory +- name: Rename noarch KPM directory become: true command: "mv {{ kpm_install_dir }}/kpm-{{ kpm_version }}-noarch {{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" when: not kpm_bin.stat.exists and kpm_arch_test.status >= 400 tags: kpm -- name: download pre-built KPM +- name: Download pre-built KPM become: true - get_url: + ansible.builtin.get_url: # Use the redirect API to support SNAPSHOT url: "{{ nexus_url }}/{{ nexus_repository }}/org/kill-bill/billing/installer/kpm/{{ kpm_version }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}.tar.gz" dest: "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}.tar.gz" @@ -78,9 +78,9 @@ when: not kpm_bin.stat.exists and kpm_arch_test.status < 400 tags: kpm -- name: install pre-built KPM +- name: Install pre-built KPM become: true - unarchive: + ansible.builtin.unarchive: src: "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}.tar.gz" remote_src: True dest: "{{ kpm_install_dir }}" @@ -89,13 +89,16 @@ when: not kpm_bin.stat.exists and kpm_arch_test.status < 400 tags: kpm -- name: symlink install directory +- name: Symlink install directory become: true - file: src="{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" path="{{ kpm_path }}" state=link + ansible.builtin.file: + src="{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" + path="{{ kpm_path }}" + state=link tags: kpm # The first time KPM is run, a Gemfile.lock needs to written out -- name: initialize KPM +- name: Initialize KPM become: true command: | "{{ kpm_path }}/kpm" version @@ -104,7 +107,11 @@ tags: kpm # The individual files have the correct permissions already, but not the top directory -- name: set correct permissions +- name: Set correct permissions become: true - file: path="{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" owner={{ kpm_owner }} group={{ kpm_group }} recurse=yes + ansible.builtin.file: + path="{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" + owner={{ kpm_owner }} + group={{ kpm_group }} + recurse=yes tags: kpm diff --git a/ansible/roles/migrations/tasks/flyway.yml b/ansible/roles/migrations/tasks/flyway.yml index ff5f4eb5..16d188a7 100644 --- a/ansible/roles/migrations/tasks/flyway.yml +++ b/ansible/roles/migrations/tasks/flyway.yml @@ -1,18 +1,21 @@ --- -- name: ensure Flyway install dir exists +- name: Ensure Flyway install dir exists become: true - file: path={{ flyway_install_dir }} state=directory mode=u=rwx,g=rx,o=rx + ansible.builtin.file: + path={{ flyway_install_dir }} + state=directory + mode=u=rwx,g=rx,o=rx tags: migrations # Note: we don't check the version but the binary is rarely updated -- name: check if Flyway is already installed +- name: Check if Flyway is already installed stat: path: "{{ flyway_install_dir }}/killbill-flyway.jar" register: flyway_bin tags: migrations - block: - - name: download killbill-flyway release metadata + - name: Download killbill-flyway release metadata uri: url: "{{ nexus_url }}/{{ nexus_repository }}/org/kill-bill/billing/killbill-util/maven-metadata.xml" return_content: yes @@ -21,23 +24,26 @@ tags: migrations # We don't use the xml module to avoid a dependency on lxml - - name: set flyway_version - set_fact: + - name: Set flyway_version + ansible.builtin.set_fact: flyway_version: "{{ flyway_metadata.content | regex_search('(.*)', '\\1') | first }}" when: flyway_version is undefined tags: migrations - - name: install Flyway + - name: Install Flyway become: true # maven_artifact module requires xml on the host - get_url: + ansible.builtin.get_url: url: "{{ nexus_url }}/{{ nexus_repository }}/org/kill-bill/billing/killbill-util/{{ flyway_version }}/killbill-util-{{ flyway_version }}-flyway.jar" dest: "{{ flyway_install_dir }}/killbill-flyway.jar" tags: migrations when: not flyway_bin.stat.exists tags: migrations -- name: set correct permissions +- name: Set correct permissions become: true - file: path="{{ flyway_install_dir }}/killbill-flyway.jar" owner={{ flyway_owner }} group={{ flyway_group }} + ansible.builtin.file: + path="{{ flyway_install_dir }}/killbill-flyway.jar" + owner={{ flyway_owner }} + group={{ flyway_group }} tags: migrations diff --git a/ansible/roles/migrations/tasks/main.yml b/ansible/roles/migrations/tasks/main.yml index 48bc5f59..e7a6264e 100644 --- a/ansible/roles/migrations/tasks/main.yml +++ b/ansible/roles/migrations/tasks/main.yml @@ -1,5 +1,5 @@ --- -- name: fetch all migrations +- name: Fetch all migrations killbill_migrations: kpm_path: "{{ kpm_path }}" bundles_dir: "{{ kb_plugins_dir }}" @@ -14,7 +14,7 @@ vars: flyway_version: "{{ migrations['migrations']['from'] }}" -- name: generate Flyway baseline tables +- name: Generate Flyway baseline tables command: "{{ flyway }} -locations=filesystem:{{ item['dir'] }} -table={{ item['table'] }} baseline" with_items: - "{{ migrations['migrations']['killbill'] }}" @@ -26,7 +26,7 @@ tags: migrations # We verify that all migrations can be generated before attempting to run them one by one -- name: validate SQL migrations for Kill Bill and Java plugins +- name: Validate SQL migrations for Kill Bill and Java plugins command: "{{ flyway }} -locations=filesystem:{{ item['dir'] }} -table={{ item['table'] }} dryRunMigrate" with_items: - "{{ migrations['migrations']['killbill'] }}" diff --git a/ansible/roles/migrations/tasks/migrate.yml b/ansible/roles/migrations/tasks/migrate.yml index 8617e8f1..6dde26ad 100644 --- a/ansible/roles/migrations/tasks/migrate.yml +++ b/ansible/roles/migrations/tasks/migrate.yml @@ -1,28 +1,28 @@ -- name: generate SQL migration +- name: Generate SQL migration command: "{{ flyway }} -locations=filesystem:{{ migration['dir'] }} -table={{ migration['table'] }} dryRunMigrate" register: java_dry_run_migrations changed_when: java_dry_run_migrations.stdout_lines tags: migrations -- name: check if there's nothing to do +- name: Check if there's nothing to do debug: msg="No migration to run for {{ migration['from_tag'] }} -> {{ migration['to_tag'] }}" when: java_dry_run_migrations.stdout.find("BEGIN;\nCOMMIT;") != -1 tags: migrations - block: - - name: print migrations + - name: Print migrations debug: msg="{{ java_dry_run_migrations.stdout_lines }}" when: java_dry_run_migrations.stdout_lines tags: migrations - - name: prompt for SQL migration + - name: Prompt for SQL migration pause: prompt='Should I run these migrations? Enter yes or no' register: should_continue when: java_dry_run_migrations.stdout_lines is defined tags: migrations - block: - - name: run SQL migration + - name: Run SQL migration command: "{{ flyway }} -locations=filesystem:{{ migration['dir'] }} -table={{ migration['table'] }} -validateOnMigrate=false migrate" register: java_migrations ignore_errors: True @@ -36,12 +36,12 @@ when: java_migrations.stderr_lines tags: migrations - - name: fail the play if the schema_version table is corrupted + - name: Fail the play if the schema_version table is corrupted fail: msg="schema_version corrupted. Try running {{ flyway }} -locations=filesystem:{{ migration['dir'] }} -table={{ migration['table'] }} repair" when: java_migrations.rc != 0 and 'contains a failed migration' in java_migrations.stderr tags: migrations - - name: fail the play if the migrations did not succeed + - name: Fail the play if the migrations did not succeed fail: msg="Migrations failed. You need to fix the tables, adjust the schema_version table manually (i.e. insert a line for that migration or update the status to success) and run {{ flyway }} -locations=filesystem:{{ migration['dir'] }} -table={{ migration['table'] }} repair" when: java_migrations.rc != 0 and 'contains a failed migration' not in java_migrations.stderr tags: migrations diff --git a/ansible/roles/tomcat/tasks/install.yml b/ansible/roles/tomcat/tasks/install.yml index 6abc4f82..ac706fff 100644 --- a/ansible/roles/tomcat/tasks/install.yml +++ b/ansible/roles/tomcat/tasks/install.yml @@ -1,7 +1,7 @@ --- - name: Ensure Tomcat install dir exists become: true - file: + ansible.builtin.file: path: "{{ tomcat_install_dir }}" state: directory mode: u=rwx,g=rx,o=rx @@ -37,14 +37,14 @@ # We don't use the xml module to avoid a dependency on lxml - name: Set tomcat_version - set_fact: + ansible.builtin.set_fact: tomcat_version: "{{ tomcat_metadata.content | regex_findall('(9.0.*)', '\\1') | last }}" when: tomcat_version is undefined tags: install - name: Install Tomcat become: true - unarchive: + ansible.builtin.unarchive: src: "http://archive.apache.org/dist/tomcat/tomcat-9/v{{ tomcat_version }}/bin/apache-tomcat-{{ tomcat_version }}.tar.gz" remote_src: True dest: "{{ tomcat_install_dir }}" @@ -55,12 +55,19 @@ # The individual files have the correct permissions already, but not the top directory - name: Set correct permissions become: true - file: path="{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" owner={{ tomcat_owner }} group={{ tomcat_group }} recurse=yes + ansible.builtin.file: + path="{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" + owner={{ tomcat_owner }} + group={{ tomcat_group }} + recurse=yes tags: install - name: Symlink install directory become: true - file: src="{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" path="{{ catalina_home }}" state=link + ansible.builtin.file: + src="{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" + path="{{ catalina_home }}" + state=link tags: install - name: Set required Tomcat environment variables diff --git a/ansible/roles/tomcat/tasks/java.yml b/ansible/roles/tomcat/tasks/java.yml index 7f4e7822..ed7ef055 100644 --- a/ansible/roles/tomcat/tasks/java.yml +++ b/ansible/roles/tomcat/tasks/java.yml @@ -1,5 +1,5 @@ --- -- name: install java +- name: Install java become: true package: > name={{ item }} @@ -8,9 +8,9 @@ - "{{ java_package }}" tags: java -- name: set default Java +- name: Set default Java become: true - file: + ansible.builtin.file: src: "{{ item.src }}" dest: "{{ item.dest }}" state: link diff --git a/ansible/roles/tomcat/tasks/json_logging.yml b/ansible/roles/tomcat/tasks/json_logging.yml index cc67b92b..9c05b33e 100644 --- a/ansible/roles/tomcat/tasks/json_logging.yml +++ b/ansible/roles/tomcat/tasks/json_logging.yml @@ -1,7 +1,7 @@ --- -- name: download Logstash dependency +- name: Download Logstash dependency become: true - get_url: + ansible.builtin.get_url: url: "{{ nexus_url }}/{{ nexus_repository }}/net/logstash/logback/logstash-logback-encoder/6.4/logstash-logback-encoder-6.4.jar" dest: /opt/logstash-logback-encoder.jar tags: @@ -9,15 +9,18 @@ - logstash - download -- name: set correct permissions +- name: Set correct permissions become: true - file: path=/opt/logstash-logback-encoder.jar owner={{ tomcat_owner }} group={{ tomcat_group }} + ansible.builtin.file: + path=/opt/logstash-logback-encoder.jar + owner={{ tomcat_owner }} + group={{ tomcat_group }} tags: - killbill-logback - logstash -- name: ensure Logstash dependency exists in the webapp - copy: +- name: Ensure Logstash dependency exists in the webapp + ansible.builtin.copy: src: /opt/logstash-logback-encoder.jar dest: "{{ catalina_base }}/webapps/ROOT/WEB-INF/lib/logstash-logback-encoder.jar" owner: "{{ tomcat_owner }}" diff --git a/ansible/roles/tomcat/tasks/main.yml b/ansible/roles/tomcat/tasks/main.yml index 6f0c7827..62193fcc 100644 --- a/ansible/roles/tomcat/tasks/main.yml +++ b/ansible/roles/tomcat/tasks/main.yml @@ -1,7 +1,12 @@ --- -- name: ensure Tomcat dirs exist +- name: Ensure Tomcat dirs exist become: true - file: path={{ catalina_base }}/{{ item }} state=directory owner={{ tomcat_owner }} group={{ tomcat_group }} mode=u=rwx,g=rx,o=rx + ansible.builtin.file: + path={{ catalina_base }}/{{ item }} + state=directory + owner={{ tomcat_owner }} + group={{ tomcat_group }} + mode=u=rwx,g=rx,o=rx with_items: - bin - conf @@ -14,7 +19,7 @@ tags: tomcat # Generate Tomcat configuration files based on environment variables -- name: generate Tomcat files +- name: Generate Tomcat files become: true template: src: "{{ item.src }}/{{ item.name }}.j2" diff --git a/ansible/roles/tomcat/tasks/native.yml b/ansible/roles/tomcat/tasks/native.yml index 22f04a92..16d091df 100644 --- a/ansible/roles/tomcat/tasks/native.yml +++ b/ansible/roles/tomcat/tasks/native.yml @@ -1,11 +1,11 @@ --- -- name: set tomcat_native_libdir - set_fact: +- name: Set tomcat_native_libdir + ansible.builtin.set_fact: tomcat_native_libdir: "{{ catalina_home }}/native-jni-lib" when: tomcat_native_libdir is undefined tags: native -- name: check if native libaries are already built +- name: Check if native libaries are already built stat: path: "{{ tomcat_native_libdir }}/libtcnative-1.so" register: libtcnative @@ -13,7 +13,7 @@ - block: - block: - - name: install toolchain + - name: Install toolchain become: true package: > name={{ item }} @@ -26,32 +26,32 @@ - make tags: native - - name: find apr-1-config path + - name: Find apr-1-config path shell: which apr-1-config register: apr_config_path_output tags: native - - name: set apr_config_path - set_fact: + - name: Set apr_config_path + ansible.builtin.set_fact: apr_config_path: "{{ apr_config_path_output.stdout }}" tags: native when: apr_config_path is undefined tags: native - block: - - name: find gnu_arch path + - name: Find gnu_arch path shell: dpkg-architecture --query DEB_BUILD_GNU_TYPE register: gnu_arch_output tags: native - - name: set gnu_arch - set_fact: + - name: Set gnu_arch + ansible.builtin.set_fact: gnu_arch: "{{ gnu_arch_output.stdout }}" tags: native when: gnu_arch is undefined tags: native - - name: create temporary build directory + - name: Create temporary build directory tempfile: state: directory suffix: tomcat-native-build @@ -59,9 +59,9 @@ tags: native # become: true needed here as the user SSH'ing in might not be able to open /usr/share/tomcat/bin - - name: expand native libraries archive + - name: Expand native libraries archive become: true - unarchive: + ansible.builtin.unarchive: src: "{{ catalina_home }}/bin/tomcat-native.tar.gz" dest: "{{ workspace.path }}" extra_opts: [--strip-components=1] @@ -69,7 +69,7 @@ remote_src: yes tags: native - - name: configure native libraries + - name: Configure native libraries command: > ./configure --build="{{ gnu_arch }}" @@ -81,26 +81,30 @@ chdir="{{ workspace.path }}/native" tags: native - - name: build native libraries + - name: Build native libraries command: > make all chdir="{{ workspace.path }}/native" tags: native - - name: install native libraries + - name: Install native libraries become: true command: > make install chdir="{{ workspace.path }}/native" tags: native - - name: set correct permissions + - name: Set correct permissions become: true - file: path={{ tomcat_native_libdir }} owner={{ tomcat_owner }} group={{ tomcat_group }} recurse=yes + ansible.builtin.file: + path={{ tomcat_native_libdir }} + owner={{ tomcat_owner }} + group={{ tomcat_group }} + recurse=yes tags: install - - name: remove temporary directory - file: + - name: Remove temporary directory + ansible.builtin.file: path="{{ workspace.path }}" state=absent tags: native diff --git a/ansible/roles/tomcat/tasks/restart.yml b/ansible/roles/tomcat/tasks/restart.yml index 8a07e12e..fc298c5c 100644 --- a/ansible/roles/tomcat/tasks/restart.yml +++ b/ansible/roles/tomcat/tasks/restart.yml @@ -1,7 +1,7 @@ --- - include: stop.yml -- name: start Tomcat +- name: Start Tomcat become: true become_user: "{{ tomcat_owner }}" environment: @@ -14,7 +14,7 @@ - catalina_home is defined - not tomcat_foreground -- name: run Tomcat +- name: Run Tomcat become: true become_user: "{{ tomcat_owner }}" environment: diff --git a/ansible/roles/tomcat/tasks/stop.yml b/ansible/roles/tomcat/tasks/stop.yml index 2e9bb8f7..c7901054 100644 --- a/ansible/roles/tomcat/tasks/stop.yml +++ b/ansible/roles/tomcat/tasks/stop.yml @@ -1,12 +1,12 @@ --- -- name: check Tomcat PID file +- name: Check Tomcat PID file stat: path="{{ catalina_base }}/tomcat.pid" register: tomcat_pid when: - catalina_home is defined tags: stop -- name: stop Tomcat (with PID file) +- name: Stop Tomcat (with PID file) become: true become_user: "{{ tomcat_owner }}" environment: @@ -18,7 +18,7 @@ - tomcat_pid is not defined or tomcat_pid.stat.exists tags: stop -- name: stop Tomcat (without PID file) +- name: Stop Tomcat (without PID file) become: true become_user: "{{ tomcat_owner }}" environment: @@ -29,7 +29,7 @@ - tomcat_pid is not defined or not tomcat_pid.stat.exists tags: stop -- name: check if war file exists +- name: Check if war file exists stat: path: "{{ catalina_base }}/{{ kb_webapps }}/ROOT.war" register: war @@ -37,10 +37,12 @@ - tomcat_cleanup - stop -- name: clean up Tomcat deployment files +- name: Clean up Tomcat deployment files become: true become_user: "{{ tomcat_owner }}" - file: path={{ catalina_base }}/{{ item }} state=absent + ansible.builtin.file: + path={{ catalina_base }}/{{ item }} + state=absent with_items: - "{{ kb_webapps }}/ROOT" - work/ diff --git a/ansible/tomcat.yml b/ansible/tomcat.yml index 1c3747a2..4c0df214 100644 --- a/ansible/tomcat.yml +++ b/ansible/tomcat.yml @@ -3,9 +3,9 @@ hosts: all tasks: - name: install Tomcat - import_tasks: roles/tomcat/tasks/install.yml + ansible.builtin.import_tasks: roles/tomcat/tasks/install.yml - name: install Tomcat native libraries - import_tasks: roles/tomcat/tasks/native.yml + ansible.builtin.import_tasks: roles/tomcat/tasks/native.yml when: java_home is defined - name: setup Tomcat - import_tasks: roles/tomcat/tasks/main.yml + ansible.builtin.import_tasks: roles/tomcat/tasks/main.yml diff --git a/ansible/tomcat_restart.yml b/ansible/tomcat_restart.yml index a462774a..6ed5b01a 100644 --- a/ansible/tomcat_restart.yml +++ b/ansible/tomcat_restart.yml @@ -4,4 +4,4 @@ become: yes tasks: - name: restart Tomcat - import_tasks: roles/tomcat/tasks/restart.yml + ansible.builtin.import_tasks: roles/tomcat/tasks/restart.yml diff --git a/ansible/tomcat_stop.yml b/ansible/tomcat_stop.yml index 66a02eda..c0beb4f5 100644 --- a/ansible/tomcat_stop.yml +++ b/ansible/tomcat_stop.yml @@ -4,4 +4,4 @@ become: yes tasks: - name: stop Tomcat - import_tasks: roles/tomcat/tasks/stop.yml + ansible.builtin.import_tasks: roles/tomcat/tasks/stop.yml From 66379403dc4cd94f5ec2e98bb560a18c97197e9d Mon Sep 17 00:00:00 2001 From: Vijay N Date: Mon, 19 Jan 2026 22:11:08 +0530 Subject: [PATCH 06/59] Fixed working directory in ansible_lint.yml --- .github/workflows/ansible_lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ansible_lint.yml b/.github/workflows/ansible_lint.yml index df6fc3cc..afb812bc 100644 --- a/.github/workflows/ansible_lint.yml +++ b/.github/workflows/ansible_lint.yml @@ -13,5 +13,5 @@ jobs: - name: Lint Ansible Playbook uses: ansible/ansible-lint@v25.9.2 with: - working_directory: ami/ansible/ + working_directory: ansible/ args: "-x 204,role-name --skip-list yaml[line-length],role-name[path]" From 501352c98f413b999f3934785a902bc53dabb3b8 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Mon, 19 Jan 2026 22:53:20 +0530 Subject: [PATCH 07/59] Fixed lint errors. --- ansible/diagnostic.yml | 6 +++--- ansible/flyway.yml | 4 ++-- ansible/java.yml | 2 +- ansible/kaui.yml | 6 +++--- ansible/kaui_json_logging.yml | 4 ++-- ansible/killbill.yml | 6 +++--- ansible/killbill_json_logging.yml | 2 +- ansible/kpm.yml | 2 +- ansible/roles/kaui/tasks/main.yml | 2 +- ansible/roles/killbill/tasks/main.yml | 2 +- ansible/roles/kpm/tasks/main.yml | 8 ++++---- ansible/roles/migrations/tasks/flyway.yml | 2 +- ansible/roles/migrations/tasks/main.yml | 4 ++-- ansible/roles/migrations/tasks/migrate.yml | 14 +++++++------- ansible/roles/tomcat/tasks/install.yml | 2 +- ansible/roles/tomcat/tasks/native.yml | 6 +++--- ansible/roles/tomcat/tasks/restart.yml | 4 ++-- ansible/roles/tomcat/tasks/stop.yml | 4 ++-- ansible/tomcat.yml | 6 +++--- ansible/tomcat_restart.yml | 2 +- ansible/tomcat_stop.yml | 2 +- 21 files changed, 45 insertions(+), 45 deletions(-) diff --git a/ansible/diagnostic.yml b/ansible/diagnostic.yml index 7c4de892..5baaec2b 100644 --- a/ansible/diagnostic.yml +++ b/ansible/diagnostic.yml @@ -2,11 +2,11 @@ - name: Gather diagnostics hosts: all tasks: - - name: setup Ruby + - name: Setup Ruby ansible.builtin.import_tasks: roles/common/tasks/main.yml - - name: setup KPM + - name: Setup KPM ansible.builtin.import_tasks: roles/kpm/tasks/main.yml - - name: gather diagnostics + - name: Gather diagnostics killbill_diagnostics: kpm_path: "{{ kpm_path }}" killbill_url: "{{ killbill_url | default('http://127.0.0.1:8080') }}" diff --git a/ansible/flyway.yml b/ansible/flyway.yml index 97cf266b..acb14c3e 100644 --- a/ansible/flyway.yml +++ b/ansible/flyway.yml @@ -2,7 +2,7 @@ - name: Install Flyway hosts: all tasks: - - name: setup Ruby + - name: Setup Ruby ansible.builtin.import_tasks: roles/common/tasks/main.yml - - name: install Flyway + - name: Install Flyway ansible.builtin.import_tasks: roles/migrations/tasks/flyway.yml diff --git a/ansible/java.yml b/ansible/java.yml index 9b257879..cfb3bfd8 100644 --- a/ansible/java.yml +++ b/ansible/java.yml @@ -6,5 +6,5 @@ default_java_home: /usr/lib/jvm/java-11-openjdk-amd64 java_home: /usr/lib/jvm/default-java tasks: - - name: install Java + - name: Install Java ansible.builtin.import_tasks: roles/tomcat/tasks/java.yml diff --git a/ansible/kaui.yml b/ansible/kaui.yml index 9286a45d..b6347976 100644 --- a/ansible/kaui.yml +++ b/ansible/kaui.yml @@ -4,9 +4,9 @@ vars: kpm_yml: /var/lib/kaui/kpm.yml tasks: - - name: setup Ruby + - name: Setup Ruby ansible.builtin.import_tasks: roles/common/tasks/main.yml - - name: setup Tomcat + - name: Setup Tomcat ansible.builtin.import_tasks: roles/tomcat/tasks/main.yml - - name: install Kaui + - name: Install Kaui ansible.builtin.import_tasks: roles/kaui/tasks/main.yml diff --git a/ansible/kaui_json_logging.yml b/ansible/kaui_json_logging.yml index d15ec6cc..cad70b58 100644 --- a/ansible/kaui_json_logging.yml +++ b/ansible/kaui_json_logging.yml @@ -2,7 +2,7 @@ - name: Configure Tomcat JSON logging for Kaui hosts: all tasks: - - name: download third-party dependencies + - name: Download third-party dependencies ansible.builtin.import_tasks: roles/kaui/tasks/json_logging.yml - - name: enable Tomcat JSON logging + - name: Enable Tomcat JSON logging ansible.builtin.import_tasks: roles/tomcat/tasks/json_logging.yml diff --git a/ansible/killbill.yml b/ansible/killbill.yml index 06de6caf..81519ad3 100644 --- a/ansible/killbill.yml +++ b/ansible/killbill.yml @@ -2,9 +2,9 @@ - name: Deploy Kill Bill hosts: all tasks: - - name: setup Ruby + - name: Setup Ruby ansible.builtin.import_tasks: roles/common/tasks/main.yml - - name: setup Tomcat + - name: Setup Tomcat ansible.builtin.import_tasks: roles/tomcat/tasks/main.yml - - name: install Kill Bill + - name: Install Kill Bill ansible.builtin.import_tasks: roles/killbill/tasks/main.yml diff --git a/ansible/killbill_json_logging.yml b/ansible/killbill_json_logging.yml index b3283180..8830ea86 100644 --- a/ansible/killbill_json_logging.yml +++ b/ansible/killbill_json_logging.yml @@ -2,5 +2,5 @@ - name: Configure Tomcat JSON logging for Kill Bill hosts: all tasks: - - name: enable Tomcat JSON logging + - name: Enable Tomcat JSON logging ansible.builtin.import_tasks: roles/tomcat/tasks/json_logging.yml diff --git a/ansible/kpm.yml b/ansible/kpm.yml index 13877f95..b10f454a 100644 --- a/ansible/kpm.yml +++ b/ansible/kpm.yml @@ -2,5 +2,5 @@ - name: Deploy KPM hosts: all tasks: - - name: install KPM + - name: Install KPM ansible.builtin.import_tasks: roles/kpm/tasks/main.yml diff --git a/ansible/roles/kaui/tasks/main.yml b/ansible/roles/kaui/tasks/main.yml index c44abf84..00b651bb 100644 --- a/ansible/roles/kaui/tasks/main.yml +++ b/ansible/roles/kaui/tasks/main.yml @@ -81,7 +81,7 @@ # Expand the WAR to speed up startup - name: Expand WAR file if not already done become: true - command: | + ansible.builtin.command: | "{{ java_home }}/bin/jar" -xf ../ROOT.war args: chdir: "{{ catalina_base }}/{{ kaui_webapps }}/ROOT" diff --git a/ansible/roles/killbill/tasks/main.yml b/ansible/roles/killbill/tasks/main.yml index 34f635e2..2a0259a0 100644 --- a/ansible/roles/killbill/tasks/main.yml +++ b/ansible/roles/killbill/tasks/main.yml @@ -96,7 +96,7 @@ # Expand the WAR to speed up startup - name: Expand WAR file if not already done become: true - command: | + ansible.builtin.command: | "{{ java_home }}/bin/jar" -xf ../ROOT.war args: chdir: "{{ catalina_base }}/{{ kb_webapps }}/ROOT" diff --git a/ansible/roles/kpm/tasks/main.yml b/ansible/roles/kpm/tasks/main.yml index 642673f3..f6edef03 100644 --- a/ansible/roles/kpm/tasks/main.yml +++ b/ansible/roles/kpm/tasks/main.yml @@ -8,7 +8,7 @@ tags: kpm - name: Download kpm release metadata - uri: + ansible.builtin.uri: url: "{{ nexus_url }}/{{ nexus_repository }}/org/kill-bill/billing/installer/kpm/maven-metadata.xml" return_content: yes register: kpm_metadata @@ -30,7 +30,7 @@ tags: kpm - name: Check if pre-built KPM exists for this arch - uri: + ansible.builtin.uri: url: "{{ nexus_url }}/{{ nexus_repository }}/org/kill-bill/billing/installer/kpm/{{ kpm_version }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}.tar.gz" method: HEAD register: kpm_arch_test @@ -63,7 +63,7 @@ # To make things easier - name: Rename noarch KPM directory become: true - command: "mv {{ kpm_install_dir }}/kpm-{{ kpm_version }}-noarch {{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" + ansible.builtin.command: "mv {{ kpm_install_dir }}/kpm-{{ kpm_version }}-noarch {{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" when: not kpm_bin.stat.exists and kpm_arch_test.status >= 400 tags: kpm @@ -100,7 +100,7 @@ # The first time KPM is run, a Gemfile.lock needs to written out - name: Initialize KPM become: true - command: | + ansible.builtin.command: | "{{ kpm_path }}/kpm" version args: creates: "{{ kpm_path }}/lib/vendor/Gemfile.lock" diff --git a/ansible/roles/migrations/tasks/flyway.yml b/ansible/roles/migrations/tasks/flyway.yml index 16d188a7..02f92d80 100644 --- a/ansible/roles/migrations/tasks/flyway.yml +++ b/ansible/roles/migrations/tasks/flyway.yml @@ -16,7 +16,7 @@ - block: - name: Download killbill-flyway release metadata - uri: + ansible.builtin.uri: url: "{{ nexus_url }}/{{ nexus_repository }}/org/kill-bill/billing/killbill-util/maven-metadata.xml" return_content: yes register: flyway_metadata diff --git a/ansible/roles/migrations/tasks/main.yml b/ansible/roles/migrations/tasks/main.yml index e7a6264e..dbeacb34 100644 --- a/ansible/roles/migrations/tasks/main.yml +++ b/ansible/roles/migrations/tasks/main.yml @@ -15,7 +15,7 @@ flyway_version: "{{ migrations['migrations']['from'] }}" - name: Generate Flyway baseline tables - command: "{{ flyway }} -locations=filesystem:{{ item['dir'] }} -table={{ item['table'] }} baseline" + ansible.builtin.command: "{{ flyway }} -locations=filesystem:{{ item['dir'] }} -table={{ item['table'] }} baseline" with_items: - "{{ migrations['migrations']['killbill'] }}" - "{{ migrations['migrations']['plugins']['java'] }}" @@ -27,7 +27,7 @@ # We verify that all migrations can be generated before attempting to run them one by one - name: Validate SQL migrations for Kill Bill and Java plugins - command: "{{ flyway }} -locations=filesystem:{{ item['dir'] }} -table={{ item['table'] }} dryRunMigrate" + ansible.builtin.command: "{{ flyway }} -locations=filesystem:{{ item['dir'] }} -table={{ item['table'] }} dryRunMigrate" with_items: - "{{ migrations['migrations']['killbill'] }}" - "{{ migrations['migrations']['plugins']['java'] }}" diff --git a/ansible/roles/migrations/tasks/migrate.yml b/ansible/roles/migrations/tasks/migrate.yml index 6dde26ad..3ca4ac3f 100644 --- a/ansible/roles/migrations/tasks/migrate.yml +++ b/ansible/roles/migrations/tasks/migrate.yml @@ -1,38 +1,38 @@ - name: Generate SQL migration - command: "{{ flyway }} -locations=filesystem:{{ migration['dir'] }} -table={{ migration['table'] }} dryRunMigrate" + ansible.builtin.command: "{{ flyway }} -locations=filesystem:{{ migration['dir'] }} -table={{ migration['table'] }} dryRunMigrate" register: java_dry_run_migrations changed_when: java_dry_run_migrations.stdout_lines tags: migrations - name: Check if there's nothing to do - debug: msg="No migration to run for {{ migration['from_tag'] }} -> {{ migration['to_tag'] }}" + ansible.builtin.debug: msg="No migration to run for {{ migration['from_tag'] }} -> {{ migration['to_tag'] }}" when: java_dry_run_migrations.stdout.find("BEGIN;\nCOMMIT;") != -1 tags: migrations - block: - name: Print migrations - debug: msg="{{ java_dry_run_migrations.stdout_lines }}" + ansible.builtin.debug: msg="{{ java_dry_run_migrations.stdout_lines }}" when: java_dry_run_migrations.stdout_lines tags: migrations - name: Prompt for SQL migration - pause: prompt='Should I run these migrations? Enter yes or no' + ansible.builtin.pause: prompt='Should I run these migrations? Enter yes or no' register: should_continue when: java_dry_run_migrations.stdout_lines is defined tags: migrations - block: - name: Run SQL migration - command: "{{ flyway }} -locations=filesystem:{{ migration['dir'] }} -table={{ migration['table'] }} -validateOnMigrate=false migrate" + ansible.builtin.command: "{{ flyway }} -locations=filesystem:{{ migration['dir'] }} -table={{ migration['table'] }} -validateOnMigrate=false migrate" register: java_migrations ignore_errors: True tags: migrations - - debug: msg="{{ java_migrations.stdout_lines }}" + - ansible.builtin.debug: msg="{{ java_migrations.stdout_lines }}" when: java_migrations.stdout_lines tags: migrations - - debug: msg="{{ java_migrations.stderr_lines }}" + - ansible.builtin.debug: msg="{{ java_migrations.stderr_lines }}" when: java_migrations.stderr_lines tags: migrations diff --git a/ansible/roles/tomcat/tasks/install.yml b/ansible/roles/tomcat/tasks/install.yml index ac706fff..18461f5e 100644 --- a/ansible/roles/tomcat/tasks/install.yml +++ b/ansible/roles/tomcat/tasks/install.yml @@ -28,7 +28,7 @@ tags: install - name: Download Tomcat release metadata - uri: + ansible.builtin.uri: url: "{{ nexus_url }}/{{ nexus_repository }}/org/apache/tomcat/tomcat/maven-metadata.xml" return_content: yes register: tomcat_metadata diff --git a/ansible/roles/tomcat/tasks/native.yml b/ansible/roles/tomcat/tasks/native.yml index 16d091df..a0c6c10b 100644 --- a/ansible/roles/tomcat/tasks/native.yml +++ b/ansible/roles/tomcat/tasks/native.yml @@ -70,7 +70,7 @@ tags: native - name: Configure native libraries - command: > + ansible.builtin.command: > ./configure --build="{{ gnu_arch }}" --libdir="{{ tomcat_native_libdir }}" @@ -82,14 +82,14 @@ tags: native - name: Build native libraries - command: > + ansible.builtin.command: > make all chdir="{{ workspace.path }}/native" tags: native - name: Install native libraries become: true - command: > + ansible.builtin.command: > make install chdir="{{ workspace.path }}/native" tags: native diff --git a/ansible/roles/tomcat/tasks/restart.yml b/ansible/roles/tomcat/tasks/restart.yml index fc298c5c..a947c61d 100644 --- a/ansible/roles/tomcat/tasks/restart.yml +++ b/ansible/roles/tomcat/tasks/restart.yml @@ -7,7 +7,7 @@ environment: CATALINA_BASE: "{{ catalina_base }}" CATALINA_PID: "{{ catalina_base }}/tomcat.pid" - command: "nohup {{ catalina_home }}/bin/catalina.sh start" + ansible.builtin.command: "nohup {{ catalina_home }}/bin/catalina.sh start" args: chdir: "{{ catalina_base }}" when: @@ -20,7 +20,7 @@ environment: CATALINA_BASE: "{{ catalina_base }}" CATALINA_PID: "{{ catalina_base }}/tomcat.pid" - command: "{{ catalina_home }}/bin/catalina.sh run" + ansible.builtin.command: "{{ catalina_home }}/bin/catalina.sh run" args: chdir: "{{ catalina_base }}" when: diff --git a/ansible/roles/tomcat/tasks/stop.yml b/ansible/roles/tomcat/tasks/stop.yml index c7901054..5eb7faec 100644 --- a/ansible/roles/tomcat/tasks/stop.yml +++ b/ansible/roles/tomcat/tasks/stop.yml @@ -12,7 +12,7 @@ environment: CATALINA_BASE: "{{ catalina_base }}" CATALINA_PID: "{{ catalina_base }}/tomcat.pid" - command: "{{ catalina_home }}/bin/catalina.sh stop 30 -force" + ansible.builtin.command: "{{ catalina_home }}/bin/catalina.sh stop 30 -force" when: - catalina_home is defined - tomcat_pid is not defined or tomcat_pid.stat.exists @@ -23,7 +23,7 @@ become_user: "{{ tomcat_owner }}" environment: CATALINA_BASE: "{{ catalina_base }}" - command: "{{ catalina_home }}/bin/catalina.sh stop 30 -force" + ansible.builtin.command: "{{ catalina_home }}/bin/catalina.sh stop 30 -force" when: - catalina_home is defined - tomcat_pid is not defined or not tomcat_pid.stat.exists diff --git a/ansible/tomcat.yml b/ansible/tomcat.yml index 4c0df214..5541a7e8 100644 --- a/ansible/tomcat.yml +++ b/ansible/tomcat.yml @@ -2,10 +2,10 @@ - name: Deploy Tomcat hosts: all tasks: - - name: install Tomcat + - name: Install Tomcat ansible.builtin.import_tasks: roles/tomcat/tasks/install.yml - - name: install Tomcat native libraries + - name: Install Tomcat native libraries ansible.builtin.import_tasks: roles/tomcat/tasks/native.yml when: java_home is defined - - name: setup Tomcat + - name: Setup Tomcat ansible.builtin.import_tasks: roles/tomcat/tasks/main.yml diff --git a/ansible/tomcat_restart.yml b/ansible/tomcat_restart.yml index 6ed5b01a..5590b602 100644 --- a/ansible/tomcat_restart.yml +++ b/ansible/tomcat_restart.yml @@ -3,5 +3,5 @@ hosts: all become: yes tasks: - - name: restart Tomcat + - name: Restart Tomcat ansible.builtin.import_tasks: roles/tomcat/tasks/restart.yml diff --git a/ansible/tomcat_stop.yml b/ansible/tomcat_stop.yml index c0beb4f5..df5666d8 100644 --- a/ansible/tomcat_stop.yml +++ b/ansible/tomcat_stop.yml @@ -3,5 +3,5 @@ hosts: all become: yes tasks: - - name: stop Tomcat + - name: Stop Tomcat ansible.builtin.import_tasks: roles/tomcat/tasks/stop.yml From 73247acaaeb495a847e9209f5fd7d60f12190074 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Mon, 19 Jan 2026 23:41:40 +0530 Subject: [PATCH 08/59] Fixed lint errors. --- ansible/roles/kaui/tasks/json_logging.yml | 6 +- ansible/roles/kaui/tasks/main.yml | 18 +- ansible/roles/killbill/tasks/main.yml | 18 +- ansible/roles/kpm/tasks/main.yml | 14 +- ansible/roles/migrations/tasks/flyway.yml | 17 +- ansible/roles/migrations/tasks/migrate.yml | 21 ++- ansible/roles/tomcat/tasks/install.yml | 20 +-- ansible/roles/tomcat/tasks/json_logging.yml | 6 +- ansible/roles/tomcat/tasks/main.yml | 10 +- ansible/roles/tomcat/tasks/native.yml | 172 ++++++++++---------- ansible/roles/tomcat/tasks/stop.yml | 4 +- 11 files changed, 159 insertions(+), 147 deletions(-) diff --git a/ansible/roles/kaui/tasks/json_logging.yml b/ansible/roles/kaui/tasks/json_logging.yml index fbe427d3..cb8beb82 100644 --- a/ansible/roles/kaui/tasks/json_logging.yml +++ b/ansible/roles/kaui/tasks/json_logging.yml @@ -25,9 +25,9 @@ - name: Set correct permissions become: true ansible.builtin.file: - path=/opt/{{ item.name }} - owner={{ tomcat_owner }} - group={{ tomcat_group }} + path: /opt/{{ item.name }} + owner: {{ tomcat_owner }} + group: {{ tomcat_group }} with_items: - name: jackson-databind.jar - name: jackson-core.jar diff --git a/ansible/roles/kaui/tasks/main.yml b/ansible/roles/kaui/tasks/main.yml index 00b651bb..95d89149 100644 --- a/ansible/roles/kaui/tasks/main.yml +++ b/ansible/roles/kaui/tasks/main.yml @@ -2,11 +2,11 @@ - name: Ensure Kaui dirs exist become: true ansible.builtin.file: - path={{ item }} - state=directory - owner={{ tomcat_owner }} - group={{ tomcat_group }} - mode=u=rwx,g=rx,o=rx + path: {{ item }} + state: directory + owner: {{ tomcat_owner }} + group: {{ tomcat_group }} + mode: u=rwx,g=rx,o=rx with_items: - "{{ kaui_install_dir }}" - "{{ kaui_plugins_dir }}" @@ -65,10 +65,10 @@ - name: Set correct permissions become: true ansible.builtin.file: - path={{ kaui_install_dir }} - owner={{ tomcat_owner }} - group={{ tomcat_group }} - recurse=yes + path: {{ kaui_install_dir }} + owner: {{ tomcat_owner }} + group: {{ tomcat_group }} + recurse: yes tags: kpm-install - name: Create ROOT directory to unarchive the WAR diff --git a/ansible/roles/killbill/tasks/main.yml b/ansible/roles/killbill/tasks/main.yml index 2a0259a0..e806d0c5 100644 --- a/ansible/roles/killbill/tasks/main.yml +++ b/ansible/roles/killbill/tasks/main.yml @@ -2,11 +2,11 @@ - name: Ensure Kill Bill dirs exist become: true ansible.builtin.file: - path={{ item }} - state=directory - owner={{ tomcat_owner }} - group={{ tomcat_group }} - mode=u=rwx,g=rx,o=rx + path: {{ item }} + state: directory + owner: {{ tomcat_owner }} + group: {{ tomcat_group }} + mode: u=rwx,g=rx,o=rx with_items: - "{{ kb_config_dir }}" - "{{ kb_plugins_dir }}" @@ -80,10 +80,10 @@ - name: Set correct permissions become: true ansible.builtin.file: - path={{ kb_install_dir }} - owner={{ tomcat_owner }} - group={{ tomcat_group }} - recurse=yes + path: {{ kb_install_dir }} + owner: {{ tomcat_owner }} + group: {{ tomcat_group }} + recurse: yes tags: kpm-install - name: Create ROOT directory to unarchive the WAR diff --git a/ansible/roles/kpm/tasks/main.yml b/ansible/roles/kpm/tasks/main.yml index f6edef03..c09c1765 100644 --- a/ansible/roles/kpm/tasks/main.yml +++ b/ansible/roles/kpm/tasks/main.yml @@ -92,9 +92,9 @@ - name: Symlink install directory become: true ansible.builtin.file: - src="{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" - path="{{ kpm_path }}" - state=link + src: "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" + path: "{{ kpm_path }}" + state: link tags: kpm # The first time KPM is run, a Gemfile.lock needs to written out @@ -110,8 +110,8 @@ - name: Set correct permissions become: true ansible.builtin.file: - path="{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" - owner={{ kpm_owner }} - group={{ kpm_group }} - recurse=yes + path: "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" + owner: {{ kpm_owner }} + group: {{ kpm_group }} + recurse: yes tags: kpm diff --git a/ansible/roles/migrations/tasks/flyway.yml b/ansible/roles/migrations/tasks/flyway.yml index 02f92d80..3f480a70 100644 --- a/ansible/roles/migrations/tasks/flyway.yml +++ b/ansible/roles/migrations/tasks/flyway.yml @@ -2,19 +2,20 @@ - name: Ensure Flyway install dir exists become: true ansible.builtin.file: - path={{ flyway_install_dir }} - state=directory - mode=u=rwx,g=rx,o=rx + path: {{ flyway_install_dir }} + state: directory + mode: u=rwx,g=rx,o=rx tags: migrations # Note: we don't check the version but the binary is rarely updated - name: Check if Flyway is already installed - stat: + ansible.builtin.stat: path: "{{ flyway_install_dir }}/killbill-flyway.jar" register: flyway_bin tags: migrations -- block: +- name: Download Kill Bill Flyway metadata + block: - name: Download killbill-flyway release metadata ansible.builtin.uri: url: "{{ nexus_url }}/{{ nexus_repository }}/org/kill-bill/billing/killbill-util/maven-metadata.xml" @@ -43,7 +44,7 @@ - name: Set correct permissions become: true ansible.builtin.file: - path="{{ flyway_install_dir }}/killbill-flyway.jar" - owner={{ flyway_owner }} - group={{ flyway_group }} + path: "{{ flyway_install_dir }}/killbill-flyway.jar" + owner: {{ flyway_owner }} + group: {{ flyway_group }} tags: migrations diff --git a/ansible/roles/migrations/tasks/migrate.yml b/ansible/roles/migrations/tasks/migrate.yml index 3ca4ac3f..cbb727d9 100644 --- a/ansible/roles/migrations/tasks/migrate.yml +++ b/ansible/roles/migrations/tasks/migrate.yml @@ -5,34 +5,41 @@ tags: migrations - name: Check if there's nothing to do - ansible.builtin.debug: msg="No migration to run for {{ migration['from_tag'] }} -> {{ migration['to_tag'] }}" + ansible.builtin.debug: + msg: "No migration to run for {{ migration['from_tag'] }} -> {{ migration['to_tag'] }}" when: java_dry_run_migrations.stdout.find("BEGIN;\nCOMMIT;") != -1 tags: migrations -- block: +- name: SQL migration + block: - name: Print migrations - ansible.builtin.debug: msg="{{ java_dry_run_migrations.stdout_lines }}" + ansible.builtin.debug: + msg: "{{ java_dry_run_migrations.stdout_lines }}" when: java_dry_run_migrations.stdout_lines tags: migrations - name: Prompt for SQL migration - ansible.builtin.pause: prompt='Should I run these migrations? Enter yes or no' + ansible.builtin.pause: + prompt: 'Should I run these migrations? Enter yes or no' register: should_continue when: java_dry_run_migrations.stdout_lines is defined tags: migrations - - block: + - name: Run migration + block: - name: Run SQL migration ansible.builtin.command: "{{ flyway }} -locations=filesystem:{{ migration['dir'] }} -table={{ migration['table'] }} -validateOnMigrate=false migrate" register: java_migrations ignore_errors: True tags: migrations - - ansible.builtin.debug: msg="{{ java_migrations.stdout_lines }}" + - ansible.builtin.debug: + msg: "{{ java_migrations.stdout_lines }}" when: java_migrations.stdout_lines tags: migrations - - ansible.builtin.debug: msg="{{ java_migrations.stderr_lines }}" + - ansible.builtin.debug: + msg: "{{ java_migrations.stderr_lines }}" when: java_migrations.stderr_lines tags: migrations diff --git a/ansible/roles/tomcat/tasks/install.yml b/ansible/roles/tomcat/tasks/install.yml index 18461f5e..270598f3 100644 --- a/ansible/roles/tomcat/tasks/install.yml +++ b/ansible/roles/tomcat/tasks/install.yml @@ -9,7 +9,7 @@ - name: Add Tomcat group become: true - group: + ansible.builtin.group: name: "{{ tomcat_group }}" state: present tags: install @@ -17,7 +17,7 @@ # Expect bash to be present -- we haven't tested the scripts with other shells - name: Add Tomcat user become: true - user: + ansible.builtin.user: name: "{{ tomcat_owner }}" comment: Kill Bill Tomcat owner group: "{{ tomcat_group }}" @@ -56,24 +56,24 @@ - name: Set correct permissions become: true ansible.builtin.file: - path="{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" - owner={{ tomcat_owner }} - group={{ tomcat_group }} - recurse=yes + path: "{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" + owner: {{ tomcat_owner }} + group: {{ tomcat_group }} + recurse: yes tags: install - name: Symlink install directory become: true ansible.builtin.file: - src="{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" - path="{{ catalina_home }}" - state=link + src: "{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" + path: "{{ catalina_home }}" + state: link tags: install - name: Set required Tomcat environment variables become: true become_user: "{{ tomcat_owner }}" - lineinfile: + ansible.builtin.lineinfile: line: "export {{ item.key }}={{ item.value }}" regexp: "^export {{ item.key }}=" path: "{{ tomcat_home }}/.profile" diff --git a/ansible/roles/tomcat/tasks/json_logging.yml b/ansible/roles/tomcat/tasks/json_logging.yml index 9c05b33e..043cc802 100644 --- a/ansible/roles/tomcat/tasks/json_logging.yml +++ b/ansible/roles/tomcat/tasks/json_logging.yml @@ -12,9 +12,9 @@ - name: Set correct permissions become: true ansible.builtin.file: - path=/opt/logstash-logback-encoder.jar - owner={{ tomcat_owner }} - group={{ tomcat_group }} + path: /opt/logstash-logback-encoder.jar + owner: {{ tomcat_owner }} + group: {{ tomcat_group }} tags: - killbill-logback - logstash diff --git a/ansible/roles/tomcat/tasks/main.yml b/ansible/roles/tomcat/tasks/main.yml index 62193fcc..13ba7fd7 100644 --- a/ansible/roles/tomcat/tasks/main.yml +++ b/ansible/roles/tomcat/tasks/main.yml @@ -2,11 +2,11 @@ - name: Ensure Tomcat dirs exist become: true ansible.builtin.file: - path={{ catalina_base }}/{{ item }} - state=directory - owner={{ tomcat_owner }} - group={{ tomcat_group }} - mode=u=rwx,g=rx,o=rx + path: {{ catalina_base }}/{{ item }} + state: directory + owner: {{ tomcat_owner }} + group: {{ tomcat_group }} + mode: u=rwx,g=rx,o=rx with_items: - bin - conf diff --git a/ansible/roles/tomcat/tasks/native.yml b/ansible/roles/tomcat/tasks/native.yml index a0c6c10b..767d2626 100644 --- a/ansible/roles/tomcat/tasks/native.yml +++ b/ansible/roles/tomcat/tasks/native.yml @@ -11,102 +11,106 @@ register: libtcnative tags: native -- block: - - block: - - name: Install toolchain - become: true - package: > - name={{ item }} - state=latest - with_items: - - dpkg-dev - - gcc - - libapr1-dev - - libssl-dev - - make - tags: native +- name: Build Tomcat native libraries + block: - - name: Find apr-1-config path - shell: which apr-1-config - register: apr_config_path_output - tags: native + - name: Prepare build toolchain + block: + - name: Install toolchain + become: true + package: > + name={{ item }} + state=latest + with_items: + - dpkg-dev + - gcc + - libapr1-dev + - libssl-dev + - make + tags: native - - name: Set apr_config_path - ansible.builtin.set_fact: - apr_config_path: "{{ apr_config_path_output.stdout }}" - tags: native - when: apr_config_path is undefined - tags: native + - name: Find apr-1-config path + shell: which apr-1-config + register: apr_config_path_output + tags: native - - block: - - name: Find gnu_arch path - shell: dpkg-architecture --query DEB_BUILD_GNU_TYPE - register: gnu_arch_output + - name: Set apr_config_path + ansible.builtin.set_fact: + apr_config_path: "{{ apr_config_path_output.stdout }}" + tags: native + when: apr_config_path is undefined tags: native - - name: Set gnu_arch - ansible.builtin.set_fact: - gnu_arch: "{{ gnu_arch_output.stdout }}" + - name: Detect GNU architecture + block: + - name: Find gnu_arch path + shell: dpkg-architecture --query DEB_BUILD_GNU_TYPE + register: gnu_arch_output + tags: native + + - name: Set gnu_arch + ansible.builtin.set_fact: + gnu_arch: "{{ gnu_arch_output.stdout }}" + tags: native + when: gnu_arch is undefined tags: native - when: gnu_arch is undefined - tags: native - - name: Create temporary build directory - tempfile: - state: directory - suffix: tomcat-native-build - register: workspace - tags: native + - name: Create temporary build directory + tempfile: + state: directory + suffix: tomcat-native-build + register: workspace + tags: native - # become: true needed here as the user SSH'ing in might not be able to open /usr/share/tomcat/bin - - name: Expand native libraries archive - become: true - ansible.builtin.unarchive: - src: "{{ catalina_home }}/bin/tomcat-native.tar.gz" - dest: "{{ workspace.path }}" - extra_opts: [--strip-components=1] - owner: "{{ ansible_user_id }}" - remote_src: yes - tags: native + # become: true needed here as the user SSH'ing in might not be able to open /usr/share/tomcat/bin + - name: Expand native libraries archive + become: true + ansible.builtin.unarchive: + src: "{{ catalina_home }}/bin/tomcat-native.tar.gz" + dest: "{{ workspace.path }}" + extra_opts: [--strip-components=1] + owner: "{{ ansible_user_id }}" + remote_src: yes + tags: native - - name: Configure native libraries - ansible.builtin.command: > - ./configure - --build="{{ gnu_arch }}" - --libdir="{{ tomcat_native_libdir }}" - --prefix="{{ catalina_home }}" - --with-apr="{{ apr_config_path }}" - --with-java-home="{{ java_home }}" - --with-ssl=yes - chdir="{{ workspace.path }}/native" - tags: native + - name: Configure native libraries + ansible.builtin.command: > + ./configure + --build="{{ gnu_arch }}" + --libdir="{{ tomcat_native_libdir }}" + --prefix="{{ catalina_home }}" + --with-apr="{{ apr_config_path }}" + --with-java-home="{{ java_home }}" + --with-ssl=yes + chdir="{{ workspace.path }}/native" + tags: native - - name: Build native libraries - ansible.builtin.command: > - make all - chdir="{{ workspace.path }}/native" - tags: native + - name: Build native libraries + ansible.builtin.command: > + make all + chdir="{{ workspace.path }}/native" + tags: native - - name: Install native libraries - become: true - ansible.builtin.command: > - make install - chdir="{{ workspace.path }}/native" - tags: native + - name: Install native libraries + become: true + ansible.builtin.command: > + make install + chdir="{{ workspace.path }}/native" + tags: native - - name: Set correct permissions - become: true - ansible.builtin.file: - path={{ tomcat_native_libdir }} - owner={{ tomcat_owner }} - group={{ tomcat_group }} - recurse=yes - tags: install + - name: Set correct permissions + become: true + ansible.builtin.file: + path: {{ tomcat_native_libdir }} + owner: {{ tomcat_owner }} + group: {{ tomcat_group }} + recurse: yes + tags: install - - name: Remove temporary directory - ansible.builtin.file: - path="{{ workspace.path }}" - state=absent - tags: native + - name: Remove temporary directory + ansible.builtin.file: + path: "{{ workspace.path }}" + state: absent + tags: native when: not libtcnative.stat.exists tags: native diff --git a/ansible/roles/tomcat/tasks/stop.yml b/ansible/roles/tomcat/tasks/stop.yml index 5eb7faec..5e515be4 100644 --- a/ansible/roles/tomcat/tasks/stop.yml +++ b/ansible/roles/tomcat/tasks/stop.yml @@ -41,8 +41,8 @@ become: true become_user: "{{ tomcat_owner }}" ansible.builtin.file: - path={{ catalina_base }}/{{ item }} - state=absent + path: {{ catalina_base }}/{{ item }} + state: absent with_items: - "{{ kb_webapps }}/ROOT" - work/ From 3f3fac59d50738c5ead600d538f040c97d366531 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Tue, 20 Jan 2026 00:00:05 +0530 Subject: [PATCH 09/59] Fixed lint errors. --- ansible/roles/common/tasks/main.yml | 3 ++- ansible/roles/kaui/tasks/json_logging.yml | 6 +++--- ansible/roles/kaui/tasks/main.yml | 12 ++++++------ ansible/roles/killbill/tasks/main.yml | 12 ++++++------ ansible/roles/kpm/tasks/main.yml | 4 ++-- ansible/roles/migrations/tasks/flyway.yml | 6 +++--- ansible/roles/migrations/tasks/migrate.yml | 6 ++++-- ansible/roles/tomcat/tasks/json_logging.yml | 4 ++-- ansible/roles/tomcat/tasks/main.yml | 6 +++--- ansible/roles/tomcat/tasks/native.yml | 6 +++--- 10 files changed, 34 insertions(+), 31 deletions(-) diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml index 42cc364f..b05e9558 100644 --- a/ansible/roles/common/tasks/main.yml +++ b/ansible/roles/common/tasks/main.yml @@ -1,4 +1,5 @@ --- - name: Ansible_ruby_interpreter setup - ansible.builtin.set_fact: ansible_ruby_interpreter="{{ kpm_path }}/lib/ruby/bin/ruby" + ansible.builtin.set_fact: + ansible_ruby_interpreter: "{{ kpm_path }}/lib/ruby/bin/ruby" tags: common diff --git a/ansible/roles/kaui/tasks/json_logging.yml b/ansible/roles/kaui/tasks/json_logging.yml index cb8beb82..84cf3a2e 100644 --- a/ansible/roles/kaui/tasks/json_logging.yml +++ b/ansible/roles/kaui/tasks/json_logging.yml @@ -25,9 +25,9 @@ - name: Set correct permissions become: true ansible.builtin.file: - path: /opt/{{ item.name }} - owner: {{ tomcat_owner }} - group: {{ tomcat_group }} + path: "/opt/{{ item.name }}" + owner: "{{ tomcat_owner }}" + group: "{{ tomcat_group }}" with_items: - name: jackson-databind.jar - name: jackson-core.jar diff --git a/ansible/roles/kaui/tasks/main.yml b/ansible/roles/kaui/tasks/main.yml index 95d89149..d7823dd6 100644 --- a/ansible/roles/kaui/tasks/main.yml +++ b/ansible/roles/kaui/tasks/main.yml @@ -2,10 +2,10 @@ - name: Ensure Kaui dirs exist become: true ansible.builtin.file: - path: {{ item }} + path: "{{ item }}" state: directory - owner: {{ tomcat_owner }} - group: {{ tomcat_group }} + owner: "{{ tomcat_owner }}" + group: "{{ tomcat_group }}" mode: u=rwx,g=rx,o=rx with_items: - "{{ kaui_install_dir }}" @@ -65,9 +65,9 @@ - name: Set correct permissions become: true ansible.builtin.file: - path: {{ kaui_install_dir }} - owner: {{ tomcat_owner }} - group: {{ tomcat_group }} + path: "{{ kaui_install_dir }}" + owner: "{{ tomcat_owner }}" + group: "{{ tomcat_group }}" recurse: yes tags: kpm-install diff --git a/ansible/roles/killbill/tasks/main.yml b/ansible/roles/killbill/tasks/main.yml index e806d0c5..7bbef1cd 100644 --- a/ansible/roles/killbill/tasks/main.yml +++ b/ansible/roles/killbill/tasks/main.yml @@ -2,10 +2,10 @@ - name: Ensure Kill Bill dirs exist become: true ansible.builtin.file: - path: {{ item }} + path: "{{ item }}" state: directory - owner: {{ tomcat_owner }} - group: {{ tomcat_group }} + owner: "{{ tomcat_owner }}" + group: "{{ tomcat_group }}" mode: u=rwx,g=rx,o=rx with_items: - "{{ kb_config_dir }}" @@ -80,9 +80,9 @@ - name: Set correct permissions become: true ansible.builtin.file: - path: {{ kb_install_dir }} - owner: {{ tomcat_owner }} - group: {{ tomcat_group }} + path: "{{ kb_install_dir }}" + owner: "{{ tomcat_owner }}" + group: "{{ tomcat_group }}" recurse: yes tags: kpm-install diff --git a/ansible/roles/kpm/tasks/main.yml b/ansible/roles/kpm/tasks/main.yml index c09c1765..eb470212 100644 --- a/ansible/roles/kpm/tasks/main.yml +++ b/ansible/roles/kpm/tasks/main.yml @@ -111,7 +111,7 @@ become: true ansible.builtin.file: path: "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" - owner: {{ kpm_owner }} - group: {{ kpm_group }} + owner: "{{ kpm_owner }}" + group: "{{ kpm_group }}" recurse: yes tags: kpm diff --git a/ansible/roles/migrations/tasks/flyway.yml b/ansible/roles/migrations/tasks/flyway.yml index 3f480a70..fbd31262 100644 --- a/ansible/roles/migrations/tasks/flyway.yml +++ b/ansible/roles/migrations/tasks/flyway.yml @@ -2,7 +2,7 @@ - name: Ensure Flyway install dir exists become: true ansible.builtin.file: - path: {{ flyway_install_dir }} + path: "{{ flyway_install_dir }}" state: directory mode: u=rwx,g=rx,o=rx tags: migrations @@ -45,6 +45,6 @@ become: true ansible.builtin.file: path: "{{ flyway_install_dir }}/killbill-flyway.jar" - owner: {{ flyway_owner }} - group: {{ flyway_group }} + owner: "{{ flyway_owner }}" + group: "{{ flyway_group }}" tags: migrations diff --git a/ansible/roles/migrations/tasks/migrate.yml b/ansible/roles/migrations/tasks/migrate.yml index cbb727d9..550ea0b7 100644 --- a/ansible/roles/migrations/tasks/migrate.yml +++ b/ansible/roles/migrations/tasks/migrate.yml @@ -44,12 +44,14 @@ tags: migrations - name: Fail the play if the schema_version table is corrupted - fail: msg="schema_version corrupted. Try running {{ flyway }} -locations=filesystem:{{ migration['dir'] }} -table={{ migration['table'] }} repair" + ansible.builtin.fail: + msg: "schema_version corrupted. Try running {{ flyway }} -locations=filesystem:{{ migration['dir'] }} -table={{ migration['table'] }} repair" when: java_migrations.rc != 0 and 'contains a failed migration' in java_migrations.stderr tags: migrations - name: Fail the play if the migrations did not succeed - fail: msg="Migrations failed. You need to fix the tables, adjust the schema_version table manually (i.e. insert a line for that migration or update the status to success) and run {{ flyway }} -locations=filesystem:{{ migration['dir'] }} -table={{ migration['table'] }} repair" + ansible.builtin.fail: + msg: "Migrations failed. You need to fix the tables, adjust the schema_version table manually (i.e. insert a line for that migration or update the status to success) and run {{ flyway }} -locations=filesystem:{{ migration['dir'] }} -table={{ migration['table'] }} repair" when: java_migrations.rc != 0 and 'contains a failed migration' not in java_migrations.stderr tags: migrations when: should_continue.user_input | bool diff --git a/ansible/roles/tomcat/tasks/json_logging.yml b/ansible/roles/tomcat/tasks/json_logging.yml index 043cc802..4530a4d2 100644 --- a/ansible/roles/tomcat/tasks/json_logging.yml +++ b/ansible/roles/tomcat/tasks/json_logging.yml @@ -13,8 +13,8 @@ become: true ansible.builtin.file: path: /opt/logstash-logback-encoder.jar - owner: {{ tomcat_owner }} - group: {{ tomcat_group }} + owner: "{{ tomcat_owner }}" + group: "{{ tomcat_group }}" tags: - killbill-logback - logstash diff --git a/ansible/roles/tomcat/tasks/main.yml b/ansible/roles/tomcat/tasks/main.yml index 13ba7fd7..cab57483 100644 --- a/ansible/roles/tomcat/tasks/main.yml +++ b/ansible/roles/tomcat/tasks/main.yml @@ -2,10 +2,10 @@ - name: Ensure Tomcat dirs exist become: true ansible.builtin.file: - path: {{ catalina_base }}/{{ item }} + path: "{{ catalina_base }}/{{ item }}" state: directory - owner: {{ tomcat_owner }} - group: {{ tomcat_group }} + owner: "{{ tomcat_owner }}" + group: "{{ tomcat_group }}" mode: u=rwx,g=rx,o=rx with_items: - bin diff --git a/ansible/roles/tomcat/tasks/native.yml b/ansible/roles/tomcat/tasks/native.yml index 767d2626..e3f3575d 100644 --- a/ansible/roles/tomcat/tasks/native.yml +++ b/ansible/roles/tomcat/tasks/native.yml @@ -101,9 +101,9 @@ - name: Set correct permissions become: true ansible.builtin.file: - path: {{ tomcat_native_libdir }} - owner: {{ tomcat_owner }} - group: {{ tomcat_group }} + path: "{{ tomcat_native_libdir }}" + owner: "{{ tomcat_owner }}" + group: "{{ tomcat_group }}" recurse: yes tags: install From d5d36676881f9b44ee6d210772d8a3dce86f2ca0 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Thu, 22 Jan 2026 18:50:10 +0530 Subject: [PATCH 10/59] Fixed lint errors. --- ansible/README.md | 4 ++-- ansible/roles/common/tasks/main.yml | 2 ++ ansible/roles/kaui/tasks/json_logging.yml | 1 + ansible/roles/kpm/tasks/main.yml | 2 +- ansible/roles/tomcat/tasks/java.yml | 2 +- ansible/roles/tomcat/tasks/main.yml | 2 +- ansible/roles/tomcat/tasks/native.yml | 26 +++++++++++------------ 7 files changed, 21 insertions(+), 18 deletions(-) diff --git a/ansible/README.md b/ansible/README.md index 339eba34..8f753314 100644 --- a/ansible/README.md +++ b/ansible/README.md @@ -54,14 +54,14 @@ ansible-playbook -i -e java_home=$TARGET_JAVA_HOME tomcat.yml For performance reasons, we recommend installing the Apache Tomcat native libraries. To do so, you need to pass a few more options to the playbook: * `gnu_arch`: the target architecture (e.g. output of `dpkg-architecture --query DEB_BUILD_GNU_TYPE`). -* `apr_config_path`: the path to `apr-1-config` (you must install the Apache Portable Runtime Library separately, i.e. `libapr1-dev`). +* `tomcat_apr_config_path`: the path to `apr-1-config` (you must install the Apache Portable Runtime Library separately, i.e. `libapr1-dev`). * `tomcat_native_libdir`: output path where the libraries will be installed. You also need to install the OpenSSL library separately (e.g. `libssl-dev`). ``` -ansible-playbook -i -e java_home=$TARGET_JAVA_HOME -e apr_config_path=/usr/bin/apr-1-config -e gnu_arch=x86_64-linux-gnu -e tomcat_native_libdir=/usr/share/tomcat/native-jni-lib tomcat.yml +ansible-playbook -i -e java_home=$TARGET_JAVA_HOME -e tomcat_apr_config_path=/usr/bin/apr-1-config -e gnu_arch=x86_64-linux-gnu -e tomcat_native_libdir=/usr/share/tomcat/native-jni-lib tomcat.yml ``` ## killbill.yml playbook diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml index b05e9558..d0ae3079 100644 --- a/ansible/roles/common/tasks/main.yml +++ b/ansible/roles/common/tasks/main.yml @@ -3,3 +3,5 @@ ansible.builtin.set_fact: ansible_ruby_interpreter: "{{ kpm_path }}/lib/ruby/bin/ruby" tags: common +# noqa: var-naming[no-role-prefix] +# Required for ansible-lint: variable must stay named 'ansible_ruby_interpreter' for Ansible to pick it up \ No newline at end of file diff --git a/ansible/roles/kaui/tasks/json_logging.yml b/ansible/roles/kaui/tasks/json_logging.yml index 84cf3a2e..76d4a336 100644 --- a/ansible/roles/kaui/tasks/json_logging.yml +++ b/ansible/roles/kaui/tasks/json_logging.yml @@ -4,6 +4,7 @@ ansible.builtin.get_url: url: "{{ nexus_url }}/{{ nexus_repository }}/{{ item.group_path }}/{{ item.artifact_id }}/{{ item.version }}/{{ item.artifact_id }}-{{ item.version }}.jar" dest: "{{ item.dest }}" + mode: '0644' with_items: - group_path: com/fasterxml/jackson/core artifact_id: jackson-databind diff --git a/ansible/roles/kpm/tasks/main.yml b/ansible/roles/kpm/tasks/main.yml index eb470212..23c28691 100644 --- a/ansible/roles/kpm/tasks/main.yml +++ b/ansible/roles/kpm/tasks/main.yml @@ -24,7 +24,7 @@ tags: kpm - name: Check if KPM is already installed - stat: + ansible.builtin.stat: path: "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}/kpm" register: kpm_bin tags: kpm diff --git a/ansible/roles/tomcat/tasks/java.yml b/ansible/roles/tomcat/tasks/java.yml index ed7ef055..aef16e39 100644 --- a/ansible/roles/tomcat/tasks/java.yml +++ b/ansible/roles/tomcat/tasks/java.yml @@ -1,7 +1,7 @@ --- - name: Install java become: true - package: > + ansible.builtin.package: > name={{ item }} state=present with_items: diff --git a/ansible/roles/tomcat/tasks/main.yml b/ansible/roles/tomcat/tasks/main.yml index cab57483..ee2c4285 100644 --- a/ansible/roles/tomcat/tasks/main.yml +++ b/ansible/roles/tomcat/tasks/main.yml @@ -21,7 +21,7 @@ # Generate Tomcat configuration files based on environment variables - name: Generate Tomcat files become: true - template: + ansible.builtin.template: src: "{{ item.src }}/{{ item.name }}.j2" dest: "{{ item.dest }}/{{ item.name }}" mode: "{{ item.mode }}" diff --git a/ansible/roles/tomcat/tasks/native.yml b/ansible/roles/tomcat/tasks/native.yml index e3f3575d..ca808815 100644 --- a/ansible/roles/tomcat/tasks/native.yml +++ b/ansible/roles/tomcat/tasks/native.yml @@ -6,21 +6,23 @@ tags: native - name: Check if native libaries are already built - stat: + ansible.builtin.stat: path: "{{ tomcat_native_libdir }}/libtcnative-1.so" - register: libtcnative + register: tomcat_libtcnative tags: native - name: Build Tomcat native libraries + when: not tomcat_libtcnative.stat.exists + tags: native block: - name: Prepare build toolchain block: - name: Install toolchain become: true - package: > - name={{ item }} - state=latest + ansible.builtin.package: + name: "{{ item }}" + state: present with_items: - dpkg-dev - gcc @@ -30,15 +32,15 @@ tags: native - name: Find apr-1-config path - shell: which apr-1-config - register: apr_config_path_output + ansible.builtin.shell: which apr-1-config + register: tomcat_apr_config_path_output tags: native - - name: Set apr_config_path + - name: Set tomcat_apr_config_path ansible.builtin.set_fact: - apr_config_path: "{{ apr_config_path_output.stdout }}" + tomcat_apr_config_path: "{{ tomcat_apr_config_path_output.stdout }}" tags: native - when: apr_config_path is undefined + when: tomcat_apr_config_path is undefined tags: native - name: Detect GNU architecture @@ -79,7 +81,7 @@ --build="{{ gnu_arch }}" --libdir="{{ tomcat_native_libdir }}" --prefix="{{ catalina_home }}" - --with-apr="{{ apr_config_path }}" + --with-apr="{{ tomcat_apr_config_path }}" --with-java-home="{{ java_home }}" --with-ssl=yes chdir="{{ workspace.path }}/native" @@ -112,5 +114,3 @@ path: "{{ workspace.path }}" state: absent tags: native - when: not libtcnative.stat.exists - tags: native From 6157bf8041d6f1c63618d75b888bbc1ec8f65491 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Thu, 22 Jan 2026 19:11:01 +0530 Subject: [PATCH 11/59] Fixed lint errors. --- ansible/README.md | 4 ++-- ansible/roles/migrations/tasks/flyway.yml | 18 ++++++++++-------- ansible/roles/migrations/tasks/main.yml | 4 ++-- ansible/roles/migrations/tasks/migrate.yml | 14 +++++++------- ansible/roles/tomcat/tasks/install.yml | 6 +++--- ansible/roles/tomcat/tasks/native.yml | 16 ++++++++-------- 6 files changed, 32 insertions(+), 30 deletions(-) diff --git a/ansible/README.md b/ansible/README.md index 8f753314..81007d9b 100644 --- a/ansible/README.md +++ b/ansible/README.md @@ -53,7 +53,7 @@ ansible-playbook -i -e java_home=$TARGET_JAVA_HOME tomcat.yml For performance reasons, we recommend installing the Apache Tomcat native libraries. To do so, you need to pass a few more options to the playbook: -* `gnu_arch`: the target architecture (e.g. output of `dpkg-architecture --query DEB_BUILD_GNU_TYPE`). +* `tomcat_gnu_arch`: the target architecture (e.g. output of `dpkg-architecture --query DEB_BUILD_GNU_TYPE`). * `tomcat_apr_config_path`: the path to `apr-1-config` (you must install the Apache Portable Runtime Library separately, i.e. `libapr1-dev`). * `tomcat_native_libdir`: output path where the libraries will be installed. @@ -61,7 +61,7 @@ For performance reasons, we recommend installing the Apache Tomcat native librar You also need to install the OpenSSL library separately (e.g. `libssl-dev`). ``` -ansible-playbook -i -e java_home=$TARGET_JAVA_HOME -e tomcat_apr_config_path=/usr/bin/apr-1-config -e gnu_arch=x86_64-linux-gnu -e tomcat_native_libdir=/usr/share/tomcat/native-jni-lib tomcat.yml +ansible-playbook -i -e java_home=$TARGET_JAVA_HOME -e tomcat_apr_config_path=/usr/bin/apr-1-config -e tomcat_gnu_arch=x86_64-linux-gnu -e tomcat_native_libdir=/usr/share/tomcat/native-jni-lib tomcat.yml ``` ## killbill.yml playbook diff --git a/ansible/roles/migrations/tasks/flyway.yml b/ansible/roles/migrations/tasks/flyway.yml index fbd31262..cf12854b 100644 --- a/ansible/roles/migrations/tasks/flyway.yml +++ b/ansible/roles/migrations/tasks/flyway.yml @@ -15,31 +15,33 @@ tags: migrations - name: Download Kill Bill Flyway metadata + when: not flyway_bin.stat.exists + tags: migrations block: - name: Download killbill-flyway release metadata ansible.builtin.uri: url: "{{ nexus_url }}/{{ nexus_repository }}/org/kill-bill/billing/killbill-util/maven-metadata.xml" return_content: yes - register: flyway_metadata - when: flyway_version is undefined + register: migrations_flyway_metadata + when: migrations_flyway_version is undefined tags: migrations # We don't use the xml module to avoid a dependency on lxml - - name: Set flyway_version + - name: Set migrations_flyway_version ansible.builtin.set_fact: - flyway_version: "{{ flyway_metadata.content | regex_search('(.*)', '\\1') | first }}" - when: flyway_version is undefined + migrations_flyway_version: "{{ migrations_flyway_metadata.content | regex_search('(.*)', '\\1') | first }}" + when: migrations_flyway_version is undefined tags: migrations - name: Install Flyway become: true # maven_artifact module requires xml on the host ansible.builtin.get_url: - url: "{{ nexus_url }}/{{ nexus_repository }}/org/kill-bill/billing/killbill-util/{{ flyway_version }}/killbill-util-{{ flyway_version }}-flyway.jar" + url: "{{ nexus_url }}/{{ nexus_repository }}/org/kill-bill/billing/killbill-util/{{ migrations_flyway_version }}/killbill-util-{{ flyway_version }}-flyway.jar" dest: "{{ flyway_install_dir }}/killbill-flyway.jar" + mode: '0644' tags: migrations - when: not flyway_bin.stat.exists - tags: migrations + - name: Set correct permissions become: true diff --git a/ansible/roles/migrations/tasks/main.yml b/ansible/roles/migrations/tasks/main.yml index dbeacb34..d068bcea 100644 --- a/ansible/roles/migrations/tasks/main.yml +++ b/ansible/roles/migrations/tasks/main.yml @@ -12,7 +12,7 @@ - include_tasks: flyway.yml vars: - flyway_version: "{{ migrations['migrations']['from'] }}" + migrations_flyway_version: "{{ migrations['migrations']['from'] }}" - name: Generate Flyway baseline tables ansible.builtin.command: "{{ flyway }} -locations=filesystem:{{ item['dir'] }} -table={{ item['table'] }} baseline" @@ -33,7 +33,7 @@ - "{{ migrations['migrations']['plugins']['java'] }}" when: item['dir'] is defined changed_when: False - register: java_dry_run_migrations + register: migrations_java_dry_run_migrations tags: migrations # Run core migrations diff --git a/ansible/roles/migrations/tasks/migrate.yml b/ansible/roles/migrations/tasks/migrate.yml index 550ea0b7..9c18fcef 100644 --- a/ansible/roles/migrations/tasks/migrate.yml +++ b/ansible/roles/migrations/tasks/migrate.yml @@ -1,28 +1,28 @@ - name: Generate SQL migration ansible.builtin.command: "{{ flyway }} -locations=filesystem:{{ migration['dir'] }} -table={{ migration['table'] }} dryRunMigrate" - register: java_dry_run_migrations - changed_when: java_dry_run_migrations.stdout_lines + register: migrations_java_dry_run_migrations + changed_when: migrations_java_dry_run_migrations.stdout_lines tags: migrations - name: Check if there's nothing to do ansible.builtin.debug: msg: "No migration to run for {{ migration['from_tag'] }} -> {{ migration['to_tag'] }}" - when: java_dry_run_migrations.stdout.find("BEGIN;\nCOMMIT;") != -1 + when: migrations_java_dry_run_migrations.stdout.find("BEGIN;\nCOMMIT;") != -1 tags: migrations - name: SQL migration block: - name: Print migrations ansible.builtin.debug: - msg: "{{ java_dry_run_migrations.stdout_lines }}" - when: java_dry_run_migrations.stdout_lines + msg: "{{ migrations_java_dry_run_migrations.stdout_lines }}" + when: migrations_java_dry_run_migrations.stdout_lines tags: migrations - name: Prompt for SQL migration ansible.builtin.pause: prompt: 'Should I run these migrations? Enter yes or no' register: should_continue - when: java_dry_run_migrations.stdout_lines is defined + when: migrations_java_dry_run_migrations.stdout_lines is defined tags: migrations - name: Run migration @@ -55,4 +55,4 @@ when: java_migrations.rc != 0 and 'contains a failed migration' not in java_migrations.stderr tags: migrations when: should_continue.user_input | bool - when: java_dry_run_migrations.stdout.find("BEGIN;\nCOMMIT;") == -1 + when: migrations_java_dry_run_migrations.stdout.find("BEGIN;\nCOMMIT;") == -1 diff --git a/ansible/roles/tomcat/tasks/install.yml b/ansible/roles/tomcat/tasks/install.yml index 270598f3..02886e2d 100644 --- a/ansible/roles/tomcat/tasks/install.yml +++ b/ansible/roles/tomcat/tasks/install.yml @@ -23,7 +23,7 @@ group: "{{ tomcat_group }}" create_home: yes home: "{{ tomcat_home }}" - shell: /bin/bash + ansible.builtin.shell: /bin/bash state: present tags: install @@ -57,8 +57,8 @@ become: true ansible.builtin.file: path: "{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" - owner: {{ tomcat_owner }} - group: {{ tomcat_group }} + owner: "{{ tomcat_owner }}" + group: "{{ tomcat_group }}" recurse: yes tags: install diff --git a/ansible/roles/tomcat/tasks/native.yml b/ansible/roles/tomcat/tasks/native.yml index ca808815..7a006c38 100644 --- a/ansible/roles/tomcat/tasks/native.yml +++ b/ansible/roles/tomcat/tasks/native.yml @@ -45,20 +45,20 @@ - name: Detect GNU architecture block: - - name: Find gnu_arch path - shell: dpkg-architecture --query DEB_BUILD_GNU_TYPE - register: gnu_arch_output + - name: Find tomcat_gnu_arch path + ansible.builtin.shell: dpkg-architecture --query DEB_BUILD_GNU_TYPE + register: tomcat_gnu_arch_output tags: native - - name: Set gnu_arch + - name: Set tomcat_gnu_arch ansible.builtin.set_fact: - gnu_arch: "{{ gnu_arch_output.stdout }}" + tomcat_gnu_arch: "{{ tomcat_gnu_arch_output.stdout }}" tags: native - when: gnu_arch is undefined + when: tomcat_gnu_arch is undefined tags: native - name: Create temporary build directory - tempfile: + ansible.builtin.tempfile: state: directory suffix: tomcat-native-build register: workspace @@ -78,7 +78,7 @@ - name: Configure native libraries ansible.builtin.command: > ./configure - --build="{{ gnu_arch }}" + --build="{{ tomcat_gnu_arch }}" --libdir="{{ tomcat_native_libdir }}" --prefix="{{ catalina_home }}" --with-apr="{{ tomcat_apr_config_path }}" From 7e21221ee6943da6cd3e7031a3a64b8543a8276f Mon Sep 17 00:00:00 2001 From: Vijay N Date: Thu, 22 Jan 2026 21:00:29 +0530 Subject: [PATCH 12/59] Fixed lint errors. --- ansible/group_vars/all.yml | 3 ++- ansible/roles/kaui/tasks/main.yml | 1 + ansible/roles/killbill/tasks/main.yml | 1 + ansible/roles/kpm/tasks/main.yml | 8 ++++++- ansible/roles/migrations/tasks/flyway.yml | 4 ++-- ansible/roles/migrations/tasks/migrate.yml | 25 ++++++++++++---------- ansible/roles/tomcat/tasks/java.yml | 6 +++--- 7 files changed, 30 insertions(+), 18 deletions(-) diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index d30c252f..1b562916 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -36,7 +36,8 @@ kaui_install_dir: /var/lib/kaui kaui_plugins_dir: "{{ kaui_install_dir }}/bundles" flyway_install_dir: /opt -flyway: java -jar {{ flyway_install_dir }}/killbill-flyway.jar -url='{{ lookup('env','KILLBILL_DAO_URL') }}' -user={{ lookup('env','KILLBILL_DAO_USER') }} -password={{ lookup('env','KILLBILL_DAO_PASSWORD') }} +flyway: java -jar {{ flyway_install_dir }}/killbill-flyway.jar -url='{{ lookup('env', 'KILLBILL_DAO_URL') }}' -user={{ lookup('env', 'KILLBILL_DAO_USER') }} -password={{ lookup('env', 'KILLBILL_DAO_PASSWORD') }} + flyway_owner: root flyway_group: root diff --git a/ansible/roles/kaui/tasks/main.yml b/ansible/roles/kaui/tasks/main.yml index d7823dd6..e7ff0da4 100644 --- a/ansible/roles/kaui/tasks/main.yml +++ b/ansible/roles/kaui/tasks/main.yml @@ -61,6 +61,7 @@ kpm_yml: "{{ kaui_kpm_yml }}" when: not existing_webapp.stat.exists tags: kpm-install + # noqa: syntax-check[unknown-module] # custom killbill module - name: Set correct permissions become: true diff --git a/ansible/roles/killbill/tasks/main.yml b/ansible/roles/killbill/tasks/main.yml index 7bbef1cd..c2b5e934 100644 --- a/ansible/roles/killbill/tasks/main.yml +++ b/ansible/roles/killbill/tasks/main.yml @@ -76,6 +76,7 @@ kpm_yml: "{{ killbill_kpm_yml }}" when: not existing_webapp.stat.exists tags: kpm-install + # noqa: syntax-check[unknown-module] # custom killbill module - name: Set correct permissions become: true diff --git a/ansible/roles/kpm/tasks/main.yml b/ansible/roles/kpm/tasks/main.yml index 23c28691..cf211746 100644 --- a/ansible/roles/kpm/tasks/main.yml +++ b/ansible/roles/kpm/tasks/main.yml @@ -46,6 +46,7 @@ dest: "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-noarch.tar.gz" owner: "{{ kpm_owner }}" group: "{{ kpm_group }}" + mode: '0644' when: not kpm_bin.stat.exists and kpm_arch_test.status >= 400 tags: kpm @@ -63,7 +64,11 @@ # To make things easier - name: Rename noarch KPM directory become: true - ansible.builtin.command: "mv {{ kpm_install_dir }}/kpm-{{ kpm_version }}-noarch {{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" + ansible.builtin.command: + cmd: > + mv {{ kpm_install_dir }}/kpm-{{ kpm_version }}-noarch + {{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }} + creates: "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" when: not kpm_bin.stat.exists and kpm_arch_test.status >= 400 tags: kpm @@ -75,6 +80,7 @@ dest: "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}.tar.gz" owner: "{{ kpm_owner }}" group: "{{ kpm_group }}" + mode: '0644' when: not kpm_bin.stat.exists and kpm_arch_test.status < 400 tags: kpm diff --git a/ansible/roles/migrations/tasks/flyway.yml b/ansible/roles/migrations/tasks/flyway.yml index cf12854b..47e8f7cd 100644 --- a/ansible/roles/migrations/tasks/flyway.yml +++ b/ansible/roles/migrations/tasks/flyway.yml @@ -11,11 +11,11 @@ - name: Check if Flyway is already installed ansible.builtin.stat: path: "{{ flyway_install_dir }}/killbill-flyway.jar" - register: flyway_bin + register: migrations_flyway_bin tags: migrations - name: Download Kill Bill Flyway metadata - when: not flyway_bin.stat.exists + when: not migrations_flyway_bin.stat.exists tags: migrations block: - name: Download killbill-flyway release metadata diff --git a/ansible/roles/migrations/tasks/migrate.yml b/ansible/roles/migrations/tasks/migrate.yml index 9c18fcef..cf65b273 100644 --- a/ansible/roles/migrations/tasks/migrate.yml +++ b/ansible/roles/migrations/tasks/migrate.yml @@ -21,38 +21,41 @@ - name: Prompt for SQL migration ansible.builtin.pause: prompt: 'Should I run these migrations? Enter yes or no' - register: should_continue + register: migrations_should_continue when: migrations_java_dry_run_migrations.stdout_lines is defined tags: migrations - name: Run migration + when: migrations_should_continue.user_input | bool block: - name: Run SQL migration ansible.builtin.command: "{{ flyway }} -locations=filesystem:{{ migration['dir'] }} -table={{ migration['table'] }} -validateOnMigrate=false migrate" - register: java_migrations + register: migrations_flyway_result ignore_errors: True + changed_when: false tags: migrations - - ansible.builtin.debug: - msg: "{{ java_migrations.stdout_lines }}" - when: java_migrations.stdout_lines + - name: Show Flyway migration output (stdout) + ansible.builtin.debug: + msg: "{{ migrations_flyway_result.stdout_lines }}" + when: migrations_flyway_result.stdout_lines tags: migrations - - ansible.builtin.debug: - msg: "{{ java_migrations.stderr_lines }}" - when: java_migrations.stderr_lines + - name: Show Flyway migration output (stderr) + ansible.builtin.debug: + msg: "{{ migrations_flyway_result.stderr_lines }}" + when: migrations_flyway_result.stderr_lines tags: migrations - name: Fail the play if the schema_version table is corrupted ansible.builtin.fail: msg: "schema_version corrupted. Try running {{ flyway }} -locations=filesystem:{{ migration['dir'] }} -table={{ migration['table'] }} repair" - when: java_migrations.rc != 0 and 'contains a failed migration' in java_migrations.stderr + when: migrations_flyway_result.rc != 0 and 'contains a failed migration' in migrations_flyway_result.stderr tags: migrations - name: Fail the play if the migrations did not succeed ansible.builtin.fail: msg: "Migrations failed. You need to fix the tables, adjust the schema_version table manually (i.e. insert a line for that migration or update the status to success) and run {{ flyway }} -locations=filesystem:{{ migration['dir'] }} -table={{ migration['table'] }} repair" - when: java_migrations.rc != 0 and 'contains a failed migration' not in java_migrations.stderr + when: migrations_flyway_result.rc != 0 and 'contains a failed migration' not in migrations_flyway_result.stderr tags: migrations - when: should_continue.user_input | bool when: migrations_java_dry_run_migrations.stdout.find("BEGIN;\nCOMMIT;") == -1 diff --git a/ansible/roles/tomcat/tasks/java.yml b/ansible/roles/tomcat/tasks/java.yml index aef16e39..415dbeb4 100644 --- a/ansible/roles/tomcat/tasks/java.yml +++ b/ansible/roles/tomcat/tasks/java.yml @@ -1,9 +1,9 @@ --- - name: Install java become: true - ansible.builtin.package: > - name={{ item }} - state=present + ansible.builtin.package: + name: "{{ item }}" + state: present with_items: - "{{ java_package }}" tags: java From fdd168e3ab68060777c323156854444b4d0313c6 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 23 Jan 2026 13:19:20 +0530 Subject: [PATCH 13/59] Fixed lint errors. --- .github/workflows/ansible_lint.yml | 2 +- ansible/roles/kaui/tasks/main.yml | 1 - ansible/roles/killbill/tasks/main.yml | 1 - ansible/roles/migrations/tasks/migrate.yml | 2 +- ansible/roles/tomcat/tasks/json_logging.yml | 1 + ansible/roles/tomcat/tasks/native.yml | 16 ++++++++++------ ansible/roles/tomcat/tasks/restart.yml | 2 +- ansible/roles/tomcat/tasks/stop.yml | 2 +- 8 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ansible_lint.yml b/.github/workflows/ansible_lint.yml index afb812bc..954ae4a7 100644 --- a/.github/workflows/ansible_lint.yml +++ b/.github/workflows/ansible_lint.yml @@ -14,4 +14,4 @@ jobs: uses: ansible/ansible-lint@v25.9.2 with: working_directory: ansible/ - args: "-x 204,role-name --skip-list yaml[line-length],role-name[path]" + args: "-x 204,role-name --skip-list role-name[path],syntax-check[unknown-module],yaml[line-length]" diff --git a/ansible/roles/kaui/tasks/main.yml b/ansible/roles/kaui/tasks/main.yml index e7ff0da4..d7823dd6 100644 --- a/ansible/roles/kaui/tasks/main.yml +++ b/ansible/roles/kaui/tasks/main.yml @@ -61,7 +61,6 @@ kpm_yml: "{{ kaui_kpm_yml }}" when: not existing_webapp.stat.exists tags: kpm-install - # noqa: syntax-check[unknown-module] # custom killbill module - name: Set correct permissions become: true diff --git a/ansible/roles/killbill/tasks/main.yml b/ansible/roles/killbill/tasks/main.yml index c2b5e934..7bbef1cd 100644 --- a/ansible/roles/killbill/tasks/main.yml +++ b/ansible/roles/killbill/tasks/main.yml @@ -76,7 +76,6 @@ kpm_yml: "{{ killbill_kpm_yml }}" when: not existing_webapp.stat.exists tags: kpm-install - # noqa: syntax-check[unknown-module] # custom killbill module - name: Set correct permissions become: true diff --git a/ansible/roles/migrations/tasks/migrate.yml b/ansible/roles/migrations/tasks/migrate.yml index cf65b273..c6312701 100644 --- a/ansible/roles/migrations/tasks/migrate.yml +++ b/ansible/roles/migrations/tasks/migrate.yml @@ -11,6 +11,7 @@ tags: migrations - name: SQL migration + when: migrations_java_dry_run_migrations.stdout.find("BEGIN;\nCOMMIT;") == -1 block: - name: Print migrations ansible.builtin.debug: @@ -58,4 +59,3 @@ msg: "Migrations failed. You need to fix the tables, adjust the schema_version table manually (i.e. insert a line for that migration or update the status to success) and run {{ flyway }} -locations=filesystem:{{ migration['dir'] }} -table={{ migration['table'] }} repair" when: migrations_flyway_result.rc != 0 and 'contains a failed migration' not in migrations_flyway_result.stderr tags: migrations - when: migrations_java_dry_run_migrations.stdout.find("BEGIN;\nCOMMIT;") == -1 diff --git a/ansible/roles/tomcat/tasks/json_logging.yml b/ansible/roles/tomcat/tasks/json_logging.yml index 4530a4d2..e5f70b22 100644 --- a/ansible/roles/tomcat/tasks/json_logging.yml +++ b/ansible/roles/tomcat/tasks/json_logging.yml @@ -4,6 +4,7 @@ ansible.builtin.get_url: url: "{{ nexus_url }}/{{ nexus_repository }}/net/logstash/logback/logstash-logback-encoder/6.4/logstash-logback-encoder-6.4.jar" dest: /opt/logstash-logback-encoder.jar + mode: '0644' tags: - killbill-logback - logstash diff --git a/ansible/roles/tomcat/tasks/native.yml b/ansible/roles/tomcat/tasks/native.yml index 7a006c38..8c2f6fb3 100644 --- a/ansible/roles/tomcat/tasks/native.yml +++ b/ansible/roles/tomcat/tasks/native.yml @@ -17,6 +17,8 @@ block: - name: Prepare build toolchain + when: tomcat_apr_config_path is undefined + tags: native block: - name: Install toolchain become: true @@ -32,30 +34,30 @@ tags: native - name: Find apr-1-config path - ansible.builtin.shell: which apr-1-config + ansible.builtin.command: which apr-1-config register: tomcat_apr_config_path_output + changed_when: false tags: native - name: Set tomcat_apr_config_path ansible.builtin.set_fact: tomcat_apr_config_path: "{{ tomcat_apr_config_path_output.stdout }}" tags: native - when: tomcat_apr_config_path is undefined - tags: native - name: Detect GNU architecture + when: tomcat_gnu_arch is undefined + tags: native block: - name: Find tomcat_gnu_arch path - ansible.builtin.shell: dpkg-architecture --query DEB_BUILD_GNU_TYPE + ansible.builtin.command: dpkg-architecture --query DEB_BUILD_GNU_TYPE register: tomcat_gnu_arch_output + changed_when: false tags: native - name: Set tomcat_gnu_arch ansible.builtin.set_fact: tomcat_gnu_arch: "{{ tomcat_gnu_arch_output.stdout }}" tags: native - when: tomcat_gnu_arch is undefined - tags: native - name: Create temporary build directory ansible.builtin.tempfile: @@ -91,6 +93,7 @@ ansible.builtin.command: > make all chdir="{{ workspace.path }}/native" + changed_when: false tags: native - name: Install native libraries @@ -98,6 +101,7 @@ ansible.builtin.command: > make install chdir="{{ workspace.path }}/native" + changed_when: false tags: native - name: Set correct permissions diff --git a/ansible/roles/tomcat/tasks/restart.yml b/ansible/roles/tomcat/tasks/restart.yml index a947c61d..48c64640 100644 --- a/ansible/roles/tomcat/tasks/restart.yml +++ b/ansible/roles/tomcat/tasks/restart.yml @@ -1,5 +1,5 @@ --- -- include: stop.yml +- include_tasks: stop.yml - name: Start Tomcat become: true diff --git a/ansible/roles/tomcat/tasks/stop.yml b/ansible/roles/tomcat/tasks/stop.yml index 5e515be4..382511d7 100644 --- a/ansible/roles/tomcat/tasks/stop.yml +++ b/ansible/roles/tomcat/tasks/stop.yml @@ -41,7 +41,7 @@ become: true become_user: "{{ tomcat_owner }}" ansible.builtin.file: - path: {{ catalina_base }}/{{ item }} + path: "{{ catalina_base }}/{{ item }}" state: absent with_items: - "{{ kb_webapps }}/ROOT" From 93ddb13ca4ea1f56471cd1a8eadc267f53b9d954 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 23 Jan 2026 13:25:24 +0530 Subject: [PATCH 14/59] Fixed lint errors. --- .github/workflows/ansible_lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ansible_lint.yml b/.github/workflows/ansible_lint.yml index 954ae4a7..9450134b 100644 --- a/.github/workflows/ansible_lint.yml +++ b/.github/workflows/ansible_lint.yml @@ -14,4 +14,4 @@ jobs: uses: ansible/ansible-lint@v25.9.2 with: working_directory: ansible/ - args: "-x 204,role-name --skip-list role-name[path],syntax-check[unknown-module],yaml[line-length]" + args: "--exclude roles/killbill/ --skip-list role-name[path],yaml[line-length]" From f47f92042b4fb2eaef44a80ea7302d12c0bc5ccb Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 23 Jan 2026 13:30:46 +0530 Subject: [PATCH 15/59] Fixed lint errors. --- .github/workflows/ansible_lint.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ansible_lint.yml b/.github/workflows/ansible_lint.yml index 9450134b..9e8a76a0 100644 --- a/.github/workflows/ansible_lint.yml +++ b/.github/workflows/ansible_lint.yml @@ -14,4 +14,5 @@ jobs: uses: ansible/ansible-lint@v25.9.2 with: working_directory: ansible/ - args: "--exclude roles/killbill/ --skip-list role-name[path],yaml[line-length]" + args: "-x 204,role-name --skip-list role-name[path],yaml[line-length] --exclude roles/killbill/ " + From 7625049e5dc794346feb71350a4d6b7ceb3a336b Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 23 Jan 2026 13:55:29 +0530 Subject: [PATCH 16/59] Fixed lint errors. --- ansible/roles/kaui/tasks/main.yml | 2 +- ansible/roles/killbill/tasks/main.yml | 2 +- ansible/roles/tomcat/tasks/native.yml | 38 ++++++++++++++------------ ansible/roles/tomcat/tasks/restart.yml | 2 +- ansible/roles/tomcat/tasks/stop.yml | 6 ++-- 5 files changed, 27 insertions(+), 23 deletions(-) diff --git a/ansible/roles/kaui/tasks/main.yml b/ansible/roles/kaui/tasks/main.yml index d7823dd6..93da5e78 100644 --- a/ansible/roles/kaui/tasks/main.yml +++ b/ansible/roles/kaui/tasks/main.yml @@ -43,7 +43,7 @@ tags: tomcat - name: Check if a ROOT webapp is already installed - stat: + ansible.builtin.stat: path: "{{ catalina_base }}/{{ kaui_webapps }}/ROOT" register: existing_webapp tags: tomcat diff --git a/ansible/roles/killbill/tasks/main.yml b/ansible/roles/killbill/tasks/main.yml index 7bbef1cd..47db7265 100644 --- a/ansible/roles/killbill/tasks/main.yml +++ b/ansible/roles/killbill/tasks/main.yml @@ -58,7 +58,7 @@ tags: tomcat - name: Check if a ROOT webapp is already installed - stat: + ansible.builtin.stat: path: "{{ catalina_base }}/{{ kb_webapps }}/ROOT" register: existing_webapp tags: tomcat diff --git a/ansible/roles/tomcat/tasks/native.yml b/ansible/roles/tomcat/tasks/native.yml index 8c2f6fb3..1cca7d4b 100644 --- a/ansible/roles/tomcat/tasks/native.yml +++ b/ansible/roles/tomcat/tasks/native.yml @@ -63,7 +63,7 @@ ansible.builtin.tempfile: state: directory suffix: tomcat-native-build - register: workspace + register: tomcat_workspace tags: native # become: true needed here as the user SSH'ing in might not be able to open /usr/share/tomcat/bin @@ -71,36 +71,38 @@ become: true ansible.builtin.unarchive: src: "{{ catalina_home }}/bin/tomcat-native.tar.gz" - dest: "{{ workspace.path }}" + dest: "{{ tomcat_workspace.path }}" extra_opts: [--strip-components=1] owner: "{{ ansible_user_id }}" remote_src: yes tags: native - name: Configure native libraries - ansible.builtin.command: > - ./configure - --build="{{ tomcat_gnu_arch }}" - --libdir="{{ tomcat_native_libdir }}" - --prefix="{{ catalina_home }}" - --with-apr="{{ tomcat_apr_config_path }}" - --with-java-home="{{ java_home }}" - --with-ssl=yes - chdir="{{ workspace.path }}/native" + ansible.builtin.command: + cmd: > + ./configure + --build="{{ tomcat_gnu_arch }}" + --libdir="{{ tomcat_native_libdir }}" + --prefix="{{ catalina_home }}" + --with-apr="{{ tomcat_apr_config_path }}" + --with-java-home="{{ java_home }}" + --with-ssl=yes + chdir: "{{ tomcat_workspace.path }}/native" + changed_when: false tags: native - name: Build native libraries - ansible.builtin.command: > - make all - chdir="{{ workspace.path }}/native" + ansible.builtin.command: + cmd: make all + chdir: "{{ tomcat_workspace.path }}/native" changed_when: false tags: native - name: Install native libraries become: true - ansible.builtin.command: > - make install - chdir="{{ workspace.path }}/native" + ansible.builtin.command: + cmd: make install + chdir: "{{ tomcat_workspace.path }}/native" changed_when: false tags: native @@ -115,6 +117,6 @@ - name: Remove temporary directory ansible.builtin.file: - path: "{{ workspace.path }}" + path: "{{ tomcat_workspace.path }}" state: absent tags: native diff --git a/ansible/roles/tomcat/tasks/restart.yml b/ansible/roles/tomcat/tasks/restart.yml index 48c64640..35b91e3e 100644 --- a/ansible/roles/tomcat/tasks/restart.yml +++ b/ansible/roles/tomcat/tasks/restart.yml @@ -1,5 +1,5 @@ --- -- include_tasks: stop.yml +- ansible.builtin.include_tasks: stop.yml - name: Start Tomcat become: true diff --git a/ansible/roles/tomcat/tasks/stop.yml b/ansible/roles/tomcat/tasks/stop.yml index 382511d7..09e20869 100644 --- a/ansible/roles/tomcat/tasks/stop.yml +++ b/ansible/roles/tomcat/tasks/stop.yml @@ -1,9 +1,10 @@ --- - name: Check Tomcat PID file - stat: path="{{ catalina_base }}/tomcat.pid" + ansible.builtin.stat: path="{{ catalina_base }}/tomcat.pid" register: tomcat_pid when: - catalina_home is defined + changed_when: false tags: stop - name: Stop Tomcat (with PID file) @@ -16,6 +17,7 @@ when: - catalina_home is defined - tomcat_pid is not defined or tomcat_pid.stat.exists + changed_when: false tags: stop - name: Stop Tomcat (without PID file) @@ -30,7 +32,7 @@ tags: stop - name: Check if war file exists - stat: + ansible.builtin.stat: path: "{{ catalina_base }}/{{ kb_webapps }}/ROOT.war" register: war tags: From 4535bf9e4b84475a046c8e134953c41929a934cd Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 23 Jan 2026 14:06:59 +0530 Subject: [PATCH 17/59] Fixed lint errors. --- .github/workflows/ansible_lint.yml | 3 +-- ansible/roles/tomcat/tasks/install.yml | 2 +- ansible/roles/tomcat/tasks/restart.yml | 5 ++++- ansible/roles/tomcat/tasks/stop.yml | 5 +++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ansible_lint.yml b/.github/workflows/ansible_lint.yml index 9e8a76a0..dc144900 100644 --- a/.github/workflows/ansible_lint.yml +++ b/.github/workflows/ansible_lint.yml @@ -14,5 +14,4 @@ jobs: uses: ansible/ansible-lint@v25.9.2 with: working_directory: ansible/ - args: "-x 204,role-name --skip-list role-name[path],yaml[line-length] --exclude roles/killbill/ " - + args: "-x 204,unknown-module,role-name --skip-list role-name[path],yaml[line-length]" diff --git a/ansible/roles/tomcat/tasks/install.yml b/ansible/roles/tomcat/tasks/install.yml index 02886e2d..08fad0ed 100644 --- a/ansible/roles/tomcat/tasks/install.yml +++ b/ansible/roles/tomcat/tasks/install.yml @@ -23,7 +23,7 @@ group: "{{ tomcat_group }}" create_home: yes home: "{{ tomcat_home }}" - ansible.builtin.shell: /bin/bash + shell: /bin/bash state: present tags: install diff --git a/ansible/roles/tomcat/tasks/restart.yml b/ansible/roles/tomcat/tasks/restart.yml index 35b91e3e..fcd6a788 100644 --- a/ansible/roles/tomcat/tasks/restart.yml +++ b/ansible/roles/tomcat/tasks/restart.yml @@ -1,5 +1,6 @@ --- -- ansible.builtin.include_tasks: stop.yml +- name: Stop Tomcat + include_tasks: stop.yml - name: Start Tomcat become: true @@ -13,6 +14,7 @@ when: - catalina_home is defined - not tomcat_foreground + changed_when: false - name: Run Tomcat become: true @@ -26,3 +28,4 @@ when: - catalina_home is defined - tomcat_foreground + changed_when: false \ No newline at end of file diff --git a/ansible/roles/tomcat/tasks/stop.yml b/ansible/roles/tomcat/tasks/stop.yml index 09e20869..60a10346 100644 --- a/ansible/roles/tomcat/tasks/stop.yml +++ b/ansible/roles/tomcat/tasks/stop.yml @@ -29,12 +29,13 @@ when: - catalina_home is defined - tomcat_pid is not defined or not tomcat_pid.stat.exists + changed_when: false tags: stop - name: Check if war file exists ansible.builtin.stat: path: "{{ catalina_base }}/{{ kb_webapps }}/ROOT.war" - register: war + register: tomcat_war tags: - tomcat_cleanup - stop @@ -50,7 +51,7 @@ - work/ when: - catalina_home is defined - - war.stat.exists + - tomcat_war.stat.exists tags: - tomcat_cleanup - stop From 6561d54091ed0e6bc7a8a11923bd1ea08089775f Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 23 Jan 2026 14:14:16 +0530 Subject: [PATCH 18/59] Fixed lint errors. --- ansible/library/{killbill => killbill.py} | 0 ansible/roles/tomcat/tasks/restart.yml | 2 +- ansible/roles/tomcat/tasks/stop.yml | 3 ++- 3 files changed, 3 insertions(+), 2 deletions(-) rename ansible/library/{killbill => killbill.py} (100%) diff --git a/ansible/library/killbill b/ansible/library/killbill.py similarity index 100% rename from ansible/library/killbill rename to ansible/library/killbill.py diff --git a/ansible/roles/tomcat/tasks/restart.yml b/ansible/roles/tomcat/tasks/restart.yml index fcd6a788..7763180e 100644 --- a/ansible/roles/tomcat/tasks/restart.yml +++ b/ansible/roles/tomcat/tasks/restart.yml @@ -1,6 +1,6 @@ --- - name: Stop Tomcat - include_tasks: stop.yml + ansible.builtin.include_tasks: stop.yml - name: Start Tomcat become: true diff --git a/ansible/roles/tomcat/tasks/stop.yml b/ansible/roles/tomcat/tasks/stop.yml index 60a10346..b934f49c 100644 --- a/ansible/roles/tomcat/tasks/stop.yml +++ b/ansible/roles/tomcat/tasks/stop.yml @@ -1,6 +1,7 @@ --- - name: Check Tomcat PID file - ansible.builtin.stat: path="{{ catalina_base }}/tomcat.pid" + ansible.builtin.stat: + path: "{{ catalina_base }}/tomcat.pid" register: tomcat_pid when: - catalina_home is defined From 6384ab05ef2b2fa6b145babe3b40df70167f93c4 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 23 Jan 2026 14:16:28 +0530 Subject: [PATCH 19/59] Fixed lint errors. --- .github/workflows/ansible_lint.yml | 4 +++- ansible/library/{killbill.py => killbill} | 0 2 files changed, 3 insertions(+), 1 deletion(-) rename ansible/library/{killbill.py => killbill} (100%) diff --git a/.github/workflows/ansible_lint.yml b/.github/workflows/ansible_lint.yml index dc144900..477dbf23 100644 --- a/.github/workflows/ansible_lint.yml +++ b/.github/workflows/ansible_lint.yml @@ -14,4 +14,6 @@ jobs: uses: ansible/ansible-lint@v25.9.2 with: working_directory: ansible/ - args: "-x 204,unknown-module,role-name --skip-list role-name[path],yaml[line-length]" + args: "-x 204,role-name --skip-list role-name[path],yaml[line-length]" + env: + ANSIBLE_LIBRARY: ./ansible/library diff --git a/ansible/library/killbill.py b/ansible/library/killbill similarity index 100% rename from ansible/library/killbill.py rename to ansible/library/killbill From 98ea8b798ca0fcfd26f445f7da96243ce986c7d3 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 23 Jan 2026 14:25:09 +0530 Subject: [PATCH 20/59] Fixed lint errors. --- .github/workflows/ansible_lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ansible_lint.yml b/.github/workflows/ansible_lint.yml index 477dbf23..55159e30 100644 --- a/.github/workflows/ansible_lint.yml +++ b/.github/workflows/ansible_lint.yml @@ -16,4 +16,4 @@ jobs: working_directory: ansible/ args: "-x 204,role-name --skip-list role-name[path],yaml[line-length]" env: - ANSIBLE_LIBRARY: ./ansible/library + ANSIBLE_LIBRARY: ${{ github.workspace }}/ansible/library From 97ca522d06dff1a07ecfbf25dbfa90782afc617a Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 23 Jan 2026 14:29:44 +0530 Subject: [PATCH 21/59] Fixed lint errors. --- ansible/roles/kaui/tasks/main.yml | 6 +++--- ansible/roles/killbill/tasks/main.yml | 8 ++++---- ansible/roles/migrations/tasks/main.yml | 8 ++++---- ansible/roles/tomcat/tasks/main.yml | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ansible/roles/kaui/tasks/main.yml b/ansible/roles/kaui/tasks/main.yml index 93da5e78..6235ee0e 100644 --- a/ansible/roles/kaui/tasks/main.yml +++ b/ansible/roles/kaui/tasks/main.yml @@ -14,7 +14,7 @@ - name: Generate kpm.yml file if needed become: true - template: + ansible.builtin.template: src: "kaui/kpm.yml.j2" dest: "{{ kaui_install_dir }}/kpm.yml" mode: u=rw,g=r,o=r @@ -27,7 +27,7 @@ # Generate Kaui-specific Tomcat configuration files based on environment variables - name: Generate Tomcat files become: true - template: + ansible.builtin.template: src: "{{ item.src }}/{{ item.name }}.j2" dest: "{{ item.dest }}/{{ item.name }}" mode: "{{ item.mode }}" @@ -91,7 +91,7 @@ # Generate logback configuration files based on environment variables - name: Copy logback.xml become: true - template: + ansible.builtin.template: src: "kaui/{{ item.name }}.j2" # Placing the logback.xml on the classpath of the webapp is the only way to support per-webapp configuration dest: "{{ catalina_base }}/{{ kaui_webapps }}/ROOT/WEB-INF/classes/logback.xml" diff --git a/ansible/roles/killbill/tasks/main.yml b/ansible/roles/killbill/tasks/main.yml index 47db7265..13a3045a 100644 --- a/ansible/roles/killbill/tasks/main.yml +++ b/ansible/roles/killbill/tasks/main.yml @@ -15,7 +15,7 @@ # Generate Kill Bill placeholder configuration files - name: Generate Kill Bill files become: true - template: + ansible.builtin.template: src: "killbill/{{ item.name }}.j2" dest: "{{ kb_config_dir }}/{{ item.name }}" mode: u=rw,g=r,o=r @@ -29,7 +29,7 @@ - name: Generate kpm.yml file if needed become: true - template: + ansible.builtin.template: src: "killbill/kpm.yml.j2" dest: "{{ kb_install_dir }}/kpm.yml" mode: u=rw,g=r,o=r @@ -42,7 +42,7 @@ # Generate Kill Bill-specific Tomcat configuration files based on environment variables - name: Generate Tomcat files become: true - template: + ansible.builtin.template: src: "{{ item.src }}/{{ item.name }}.j2" dest: "{{ item.dest }}/{{ item.name }}" mode: "{{ item.mode }}" @@ -106,7 +106,7 @@ # Generate logback configuration files based on environment variables - name: Copy logback.xml become: true - template: + ansible.builtin.template: src: "killbill/{{ item.name }}.j2" # Placing the logback.xml on the classpath of the webapp is the only way to support per-webapp configuration dest: "{{ catalina_base }}/{{ kb_webapps }}/ROOT/WEB-INF/classes/logback.xml" diff --git a/ansible/roles/migrations/tasks/main.yml b/ansible/roles/migrations/tasks/main.yml index d068bcea..9ad1168f 100644 --- a/ansible/roles/migrations/tasks/main.yml +++ b/ansible/roles/migrations/tasks/main.yml @@ -6,11 +6,11 @@ kaui_web_path: "{{ catalina_base }}/{{ kaui_webapps }}/ROOT.war" killbill_web_path: "{{ catalina_base }}/{{ kb_webapps }}/ROOT.war" kpm_yml: "{{ kpm_yml }}" - gh_token: "{{ gh_token|default('') }}" + gh_token: "{{ gh_token | default('') }}" register: migrations tags: migrations -- include_tasks: flyway.yml +- ansible.builtin.include_tasks: flyway.yml vars: migrations_flyway_version: "{{ migrations['migrations']['from'] }}" @@ -37,7 +37,7 @@ tags: migrations # Run core migrations -- include_tasks: migrate.yml +- ansible.builtin.include_tasks: migrate.yml loop: - "{{ migrations['migrations']['killbill'] }}" loop_control: @@ -45,7 +45,7 @@ when: migration['dir'] is defined # Run plugin migrations -- include_tasks: migrate.yml +- ansible.builtin.include_tasks: migrate.yml loop: "{{ migrations['migrations']['plugins']['java']|flatten(levels=1) }}" loop_control: loop_var: migration diff --git a/ansible/roles/tomcat/tasks/main.yml b/ansible/roles/tomcat/tasks/main.yml index ee2c4285..38be736b 100644 --- a/ansible/roles/tomcat/tasks/main.yml +++ b/ansible/roles/tomcat/tasks/main.yml @@ -21,7 +21,7 @@ # Generate Tomcat configuration files based on environment variables - name: Generate Tomcat files become: true - ansible.builtin.template: + ansible.builtin.ansible.builtin.template: src: "{{ item.src }}/{{ item.name }}.j2" dest: "{{ item.dest }}/{{ item.name }}" mode: "{{ item.mode }}" From 51971d02ffcfdaf2c6ea2ce287569c5bddbeb36c Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 23 Jan 2026 14:38:24 +0530 Subject: [PATCH 22/59] Fixed lint errors. --- ansible/roles/kaui/tasks/main.yml | 4 ++-- ansible/roles/killbill/tasks/main.yml | 4 ++-- ansible/roles/migrations/tasks/main.yml | 17 ++++++++++------- ansible/roles/tomcat/tasks/main.yml | 2 +- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/ansible/roles/kaui/tasks/main.yml b/ansible/roles/kaui/tasks/main.yml index 6235ee0e..1d8f32e5 100644 --- a/ansible/roles/kaui/tasks/main.yml +++ b/ansible/roles/kaui/tasks/main.yml @@ -45,7 +45,7 @@ - name: Check if a ROOT webapp is already installed ansible.builtin.stat: path: "{{ catalina_base }}/{{ kaui_webapps }}/ROOT" - register: existing_webapp + register: kaui_existing_webapp tags: tomcat # Only run kpm install if there is no exploded webapp already. Otherwise, @@ -59,7 +59,7 @@ killbill: kpm_path: "{{ kpm_path }}" kpm_yml: "{{ kaui_kpm_yml }}" - when: not existing_webapp.stat.exists + when: not kaui_existing_webapp.stat.exists tags: kpm-install - name: Set correct permissions diff --git a/ansible/roles/killbill/tasks/main.yml b/ansible/roles/killbill/tasks/main.yml index 13a3045a..d2993358 100644 --- a/ansible/roles/killbill/tasks/main.yml +++ b/ansible/roles/killbill/tasks/main.yml @@ -60,7 +60,7 @@ - name: Check if a ROOT webapp is already installed ansible.builtin.stat: path: "{{ catalina_base }}/{{ kb_webapps }}/ROOT" - register: existing_webapp + register: killbill_existing_webapp tags: tomcat # Only run kpm install if there is no exploded webapp already. Otherwise, @@ -74,7 +74,7 @@ killbill: kpm_path: "{{ kpm_path }}" kpm_yml: "{{ killbill_kpm_yml }}" - when: not existing_webapp.stat.exists + when: not killbill_existing_webapp.stat.exists tags: kpm-install - name: Set correct permissions diff --git a/ansible/roles/migrations/tasks/main.yml b/ansible/roles/migrations/tasks/main.yml index 9ad1168f..6b03eea8 100644 --- a/ansible/roles/migrations/tasks/main.yml +++ b/ansible/roles/migrations/tasks/main.yml @@ -10,7 +10,8 @@ register: migrations tags: migrations -- ansible.builtin.include_tasks: flyway.yml +- name: Include flyway.yml + ansible.builtin.include_tasks: flyway.yml vars: migrations_flyway_version: "{{ migrations['migrations']['from'] }}" @@ -20,9 +21,9 @@ - "{{ migrations['migrations']['killbill'] }}" - "{{ migrations['migrations']['plugins']['java'] }}" when: item['dir'] is defined - register: baselineout - failed_when: baselineout.rc != 0 and 'as it already contains migrations' not in baselineout.stderr - changed_when: "'already initialized with' not in baselineout.stdout and 'as it already contains migrations' not in baselineout.stderr" + register: migrations_baselineout + failed_when: migrations_baselineout.rc != 0 and 'as it already contains migrations' not in baselineout.stderr + changed_when: "'already initialized with' not in migrations_baselineout.stdout and 'as it already contains migrations' not in baselineout.stderr" tags: migrations # We verify that all migrations can be generated before attempting to run them one by one @@ -37,7 +38,8 @@ tags: migrations # Run core migrations -- ansible.builtin.include_tasks: migrate.yml +- name: Run core migrations + ansible.builtin.include_tasks: migrate.yml loop: - "{{ migrations['migrations']['killbill'] }}" loop_control: @@ -45,8 +47,9 @@ when: migration['dir'] is defined # Run plugin migrations -- ansible.builtin.include_tasks: migrate.yml - loop: "{{ migrations['migrations']['plugins']['java']|flatten(levels=1) }}" +- name: Run plugin migrations + ansible.builtin.include_tasks: migrate.yml + loop: "{{ migrations['migrations']['plugins']['java'] | flatten(levels=1) }}" loop_control: loop_var: migration when: migration['dir'] is defined diff --git a/ansible/roles/tomcat/tasks/main.yml b/ansible/roles/tomcat/tasks/main.yml index 38be736b..ee2c4285 100644 --- a/ansible/roles/tomcat/tasks/main.yml +++ b/ansible/roles/tomcat/tasks/main.yml @@ -21,7 +21,7 @@ # Generate Tomcat configuration files based on environment variables - name: Generate Tomcat files become: true - ansible.builtin.ansible.builtin.template: + ansible.builtin.template: src: "{{ item.src }}/{{ item.name }}.j2" dest: "{{ item.dest }}/{{ item.name }}" mode: "{{ item.mode }}" From 7c10b2dfc6de2009d6c55511144a93620f93faf1 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 23 Jan 2026 14:46:42 +0530 Subject: [PATCH 23/59] Fixed lint errors. --- ansible/roles/migrations/tasks/main.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ansible/roles/migrations/tasks/main.yml b/ansible/roles/migrations/tasks/main.yml index 6b03eea8..534b4251 100644 --- a/ansible/roles/migrations/tasks/main.yml +++ b/ansible/roles/migrations/tasks/main.yml @@ -7,19 +7,19 @@ killbill_web_path: "{{ catalina_base }}/{{ kb_webapps }}/ROOT.war" kpm_yml: "{{ kpm_yml }}" gh_token: "{{ gh_token | default('') }}" - register: migrations + register: migrations_result tags: migrations - name: Include flyway.yml ansible.builtin.include_tasks: flyway.yml vars: - migrations_flyway_version: "{{ migrations['migrations']['from'] }}" + migrations_flyway_version: "{{ migrations_result['migrations']['from'] }}" - name: Generate Flyway baseline tables ansible.builtin.command: "{{ flyway }} -locations=filesystem:{{ item['dir'] }} -table={{ item['table'] }} baseline" with_items: - - "{{ migrations['migrations']['killbill'] }}" - - "{{ migrations['migrations']['plugins']['java'] }}" + - "{{ migrations_result['migrations']['killbill'] }}" + - "{{ migrations_result['migrations']['plugins']['java'] }}" when: item['dir'] is defined register: migrations_baselineout failed_when: migrations_baselineout.rc != 0 and 'as it already contains migrations' not in baselineout.stderr @@ -30,8 +30,8 @@ - name: Validate SQL migrations for Kill Bill and Java plugins ansible.builtin.command: "{{ flyway }} -locations=filesystem:{{ item['dir'] }} -table={{ item['table'] }} dryRunMigrate" with_items: - - "{{ migrations['migrations']['killbill'] }}" - - "{{ migrations['migrations']['plugins']['java'] }}" + - "{{ migrations_result['migrations']['killbill'] }}" + - "{{ migrations_result['migrations']['plugins']['java'] }}" when: item['dir'] is defined changed_when: False register: migrations_java_dry_run_migrations From 1750b032e576d95991239bac0d5cf0d97f72747b Mon Sep 17 00:00:00 2001 From: Vijay N Date: Thu, 29 Jan 2026 09:21:16 +0530 Subject: [PATCH 24/59] Fixed lint errors. --- ansible/kaui.yml | 2 +- ansible/roles/common/tasks/main.yml | 2 +- ansible/roles/migrations/tasks/flyway.yml | 2 +- ansible/roles/migrations/tasks/main.yml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ansible/kaui.yml b/ansible/kaui.yml index b6347976..5662246a 100644 --- a/ansible/kaui.yml +++ b/ansible/kaui.yml @@ -2,7 +2,7 @@ - name: Deploy Kaui hosts: all vars: - kpm_yml: /var/lib/kaui/kpm.yml + kaui_kpm_yml: /var/lib/kaui/kpm.yml tasks: - name: Setup Ruby ansible.builtin.import_tasks: roles/common/tasks/main.yml diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml index d0ae3079..a134f58d 100644 --- a/ansible/roles/common/tasks/main.yml +++ b/ansible/roles/common/tasks/main.yml @@ -1,5 +1,5 @@ --- -- name: Ansible_ruby_interpreter setup +- name: Setup Ansible ruby interpreter ansible.builtin.set_fact: ansible_ruby_interpreter: "{{ kpm_path }}/lib/ruby/bin/ruby" tags: common diff --git a/ansible/roles/migrations/tasks/flyway.yml b/ansible/roles/migrations/tasks/flyway.yml index 47e8f7cd..d3165661 100644 --- a/ansible/roles/migrations/tasks/flyway.yml +++ b/ansible/roles/migrations/tasks/flyway.yml @@ -37,7 +37,7 @@ become: true # maven_artifact module requires xml on the host ansible.builtin.get_url: - url: "{{ nexus_url }}/{{ nexus_repository }}/org/kill-bill/billing/killbill-util/{{ migrations_flyway_version }}/killbill-util-{{ flyway_version }}-flyway.jar" + url: "{{ nexus_url }}/{{ nexus_repository }}/org/kill-bill/billing/killbill-util/{{ migrations_flyway_version }}/killbill-util-{{ migrations_flyway_version }}-flyway.jar" dest: "{{ flyway_install_dir }}/killbill-flyway.jar" mode: '0644' tags: migrations diff --git a/ansible/roles/migrations/tasks/main.yml b/ansible/roles/migrations/tasks/main.yml index 534b4251..2b48119c 100644 --- a/ansible/roles/migrations/tasks/main.yml +++ b/ansible/roles/migrations/tasks/main.yml @@ -22,8 +22,8 @@ - "{{ migrations_result['migrations']['plugins']['java'] }}" when: item['dir'] is defined register: migrations_baselineout - failed_when: migrations_baselineout.rc != 0 and 'as it already contains migrations' not in baselineout.stderr - changed_when: "'already initialized with' not in migrations_baselineout.stdout and 'as it already contains migrations' not in baselineout.stderr" + failed_when: migrations_baselineout.rc != 0 and 'as it already contains migrations' not in migrations_baselineout.stderr + changed_when: "'already initialized with' not in migrations_baselineout.stdout and 'as it already contains migrations' not in migrations_baselineout.stderr" tags: migrations # We verify that all migrations can be generated before attempting to run them one by one From 749996b044250aac083745a30196cf4e45223e66 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Thu, 29 Jan 2026 09:56:40 +0530 Subject: [PATCH 25/59] Fixed lint errors. --- .github/workflows/ansible_lint.yml | 2 +- ansible/README.md | 2 +- ansible/diagnostic.yml | 4 ++-- ansible/flyway.yml | 4 ++-- ansible/java.yml | 2 +- ansible/kaui.yml | 6 +++--- ansible/kaui_json_logging.yml | 4 ++-- ansible/killbill.yml | 6 +++--- ansible/killbill_json_logging.yml | 2 +- ansible/kpm.yml | 2 +- ansible/tomcat.yml | 6 +++--- ansible/tomcat_restart.yml | 2 +- ansible/tomcat_stop.yml | 2 +- 13 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ansible_lint.yml b/.github/workflows/ansible_lint.yml index 55159e30..07aece22 100644 --- a/.github/workflows/ansible_lint.yml +++ b/.github/workflows/ansible_lint.yml @@ -14,6 +14,6 @@ jobs: uses: ansible/ansible-lint@v25.9.2 with: working_directory: ansible/ - args: "-x 204,role-name --skip-list role-name[path],yaml[line-length]" + args: "-x role-name,fqcn-builtins,role-name[path],yaml[line-length]" env: ANSIBLE_LIBRARY: ${{ github.workspace }}/ansible/library diff --git a/ansible/README.md b/ansible/README.md index 81007d9b..dca0883e 100644 --- a/ansible/README.md +++ b/ansible/README.md @@ -153,7 +153,7 @@ To build upon these roles, you can create your own play, e.g.: include_role: name: killbill-cloud/ansible/roles/killbill - name: customize Kill Bill - ansible.builtin.import_tasks: roles/acme/tasks/main.yml + import_tasks: roles/acme/tasks/main.yml ``` Note that you need to have your own templates directory, containing your own templates. diff --git a/ansible/diagnostic.yml b/ansible/diagnostic.yml index 5baaec2b..377a8e14 100644 --- a/ansible/diagnostic.yml +++ b/ansible/diagnostic.yml @@ -3,9 +3,9 @@ hosts: all tasks: - name: Setup Ruby - ansible.builtin.import_tasks: roles/common/tasks/main.yml + import_tasks: roles/common/tasks/main.yml - name: Setup KPM - ansible.builtin.import_tasks: roles/kpm/tasks/main.yml + import_tasks: roles/kpm/tasks/main.yml - name: Gather diagnostics killbill_diagnostics: kpm_path: "{{ kpm_path }}" diff --git a/ansible/flyway.yml b/ansible/flyway.yml index acb14c3e..07bb4fd0 100644 --- a/ansible/flyway.yml +++ b/ansible/flyway.yml @@ -3,6 +3,6 @@ hosts: all tasks: - name: Setup Ruby - ansible.builtin.import_tasks: roles/common/tasks/main.yml + import_tasks: roles/common/tasks/main.yml - name: Install Flyway - ansible.builtin.import_tasks: roles/migrations/tasks/flyway.yml + import_tasks: roles/migrations/tasks/flyway.yml diff --git a/ansible/java.yml b/ansible/java.yml index cfb3bfd8..79746525 100644 --- a/ansible/java.yml +++ b/ansible/java.yml @@ -7,4 +7,4 @@ java_home: /usr/lib/jvm/default-java tasks: - name: Install Java - ansible.builtin.import_tasks: roles/tomcat/tasks/java.yml + import_tasks: roles/tomcat/tasks/java.yml diff --git a/ansible/kaui.yml b/ansible/kaui.yml index 5662246a..3bf74e3f 100644 --- a/ansible/kaui.yml +++ b/ansible/kaui.yml @@ -5,8 +5,8 @@ kaui_kpm_yml: /var/lib/kaui/kpm.yml tasks: - name: Setup Ruby - ansible.builtin.import_tasks: roles/common/tasks/main.yml + import_tasks: roles/common/tasks/main.yml - name: Setup Tomcat - ansible.builtin.import_tasks: roles/tomcat/tasks/main.yml + import_tasks: roles/tomcat/tasks/main.yml - name: Install Kaui - ansible.builtin.import_tasks: roles/kaui/tasks/main.yml + import_tasks: roles/kaui/tasks/main.yml diff --git a/ansible/kaui_json_logging.yml b/ansible/kaui_json_logging.yml index cad70b58..e359daed 100644 --- a/ansible/kaui_json_logging.yml +++ b/ansible/kaui_json_logging.yml @@ -3,6 +3,6 @@ hosts: all tasks: - name: Download third-party dependencies - ansible.builtin.import_tasks: roles/kaui/tasks/json_logging.yml + import_tasks: roles/kaui/tasks/json_logging.yml - name: Enable Tomcat JSON logging - ansible.builtin.import_tasks: roles/tomcat/tasks/json_logging.yml + import_tasks: roles/tomcat/tasks/json_logging.yml diff --git a/ansible/killbill.yml b/ansible/killbill.yml index 81519ad3..e86498ce 100644 --- a/ansible/killbill.yml +++ b/ansible/killbill.yml @@ -3,8 +3,8 @@ hosts: all tasks: - name: Setup Ruby - ansible.builtin.import_tasks: roles/common/tasks/main.yml + import_tasks: roles/common/tasks/main.yml - name: Setup Tomcat - ansible.builtin.import_tasks: roles/tomcat/tasks/main.yml + import_tasks: roles/tomcat/tasks/main.yml - name: Install Kill Bill - ansible.builtin.import_tasks: roles/killbill/tasks/main.yml + import_tasks: roles/killbill/tasks/main.yml diff --git a/ansible/killbill_json_logging.yml b/ansible/killbill_json_logging.yml index 8830ea86..dd937983 100644 --- a/ansible/killbill_json_logging.yml +++ b/ansible/killbill_json_logging.yml @@ -3,4 +3,4 @@ hosts: all tasks: - name: Enable Tomcat JSON logging - ansible.builtin.import_tasks: roles/tomcat/tasks/json_logging.yml + import_tasks: roles/tomcat/tasks/json_logging.yml diff --git a/ansible/kpm.yml b/ansible/kpm.yml index b10f454a..23803270 100644 --- a/ansible/kpm.yml +++ b/ansible/kpm.yml @@ -3,4 +3,4 @@ hosts: all tasks: - name: Install KPM - ansible.builtin.import_tasks: roles/kpm/tasks/main.yml + import_tasks: roles/kpm/tasks/main.yml diff --git a/ansible/tomcat.yml b/ansible/tomcat.yml index 5541a7e8..58e6cf29 100644 --- a/ansible/tomcat.yml +++ b/ansible/tomcat.yml @@ -3,9 +3,9 @@ hosts: all tasks: - name: Install Tomcat - ansible.builtin.import_tasks: roles/tomcat/tasks/install.yml + import_tasks: roles/tomcat/tasks/install.yml - name: Install Tomcat native libraries - ansible.builtin.import_tasks: roles/tomcat/tasks/native.yml + import_tasks: roles/tomcat/tasks/native.yml when: java_home is defined - name: Setup Tomcat - ansible.builtin.import_tasks: roles/tomcat/tasks/main.yml + import_tasks: roles/tomcat/tasks/main.yml diff --git a/ansible/tomcat_restart.yml b/ansible/tomcat_restart.yml index 5590b602..d3be03e0 100644 --- a/ansible/tomcat_restart.yml +++ b/ansible/tomcat_restart.yml @@ -4,4 +4,4 @@ become: yes tasks: - name: Restart Tomcat - ansible.builtin.import_tasks: roles/tomcat/tasks/restart.yml + import_tasks: roles/tomcat/tasks/restart.yml diff --git a/ansible/tomcat_stop.yml b/ansible/tomcat_stop.yml index df5666d8..ea67b595 100644 --- a/ansible/tomcat_stop.yml +++ b/ansible/tomcat_stop.yml @@ -4,4 +4,4 @@ become: yes tasks: - name: Stop Tomcat - ansible.builtin.import_tasks: roles/tomcat/tasks/stop.yml + import_tasks: roles/tomcat/tasks/stop.yml From 0af777a0d838b6ee69117365bbb4e8add6b1a59b Mon Sep 17 00:00:00 2001 From: Vijay N Date: Thu, 29 Jan 2026 10:04:23 +0530 Subject: [PATCH 26/59] Fixed lint errors. --- .github/workflows/ansible_lint.yml | 2 +- ansible/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ansible_lint.yml b/.github/workflows/ansible_lint.yml index 55159e30..07aece22 100644 --- a/.github/workflows/ansible_lint.yml +++ b/.github/workflows/ansible_lint.yml @@ -14,6 +14,6 @@ jobs: uses: ansible/ansible-lint@v25.9.2 with: working_directory: ansible/ - args: "-x 204,role-name --skip-list role-name[path],yaml[line-length]" + args: "-x role-name,fqcn-builtins,role-name[path],yaml[line-length]" env: ANSIBLE_LIBRARY: ${{ github.workspace }}/ansible/library diff --git a/ansible/README.md b/ansible/README.md index 81007d9b..dca0883e 100644 --- a/ansible/README.md +++ b/ansible/README.md @@ -153,7 +153,7 @@ To build upon these roles, you can create your own play, e.g.: include_role: name: killbill-cloud/ansible/roles/killbill - name: customize Kill Bill - ansible.builtin.import_tasks: roles/acme/tasks/main.yml + import_tasks: roles/acme/tasks/main.yml ``` Note that you need to have your own templates directory, containing your own templates. From 3fff787cfd2358925754f8306688403a62e39724 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Thu, 29 Jan 2026 10:09:39 +0530 Subject: [PATCH 27/59] Fixed lint errors. --- .github/workflows/ansible_lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ansible_lint.yml b/.github/workflows/ansible_lint.yml index 07aece22..a9cc1e93 100644 --- a/.github/workflows/ansible_lint.yml +++ b/.github/workflows/ansible_lint.yml @@ -14,6 +14,6 @@ jobs: uses: ansible/ansible-lint@v25.9.2 with: working_directory: ansible/ - args: "-x role-name,fqcn-builtins,role-name[path],yaml[line-length]" + args: "-x role-name,fqcn-builtins,fqcn[action-core],role-name[path],yaml[line-length]" env: ANSIBLE_LIBRARY: ${{ github.workspace }}/ansible/library From 709a0d5afaeb9f2beb62190a9a7530fd70b43517 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Thu, 29 Jan 2026 10:25:07 +0530 Subject: [PATCH 28/59] Fixed lint errors. --- .github/workflows/ansible_lint.yml | 2 +- docker/templates/kaui/latest/Dockerfile.template | 1 + docker/templates/killbill/latest/Dockerfile.template | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ansible_lint.yml b/.github/workflows/ansible_lint.yml index a9cc1e93..cd239af0 100644 --- a/.github/workflows/ansible_lint.yml +++ b/.github/workflows/ansible_lint.yml @@ -14,6 +14,6 @@ jobs: uses: ansible/ansible-lint@v25.9.2 with: working_directory: ansible/ - args: "-x role-name,fqcn-builtins,fqcn[action-core],role-name[path],yaml[line-length]" + args: "-x role-name,fqcn[action-core],role-name[path],yaml[line-length]" env: ANSIBLE_LIBRARY: ${{ github.workspace }}/ansible/library diff --git a/docker/templates/kaui/latest/Dockerfile.template b/docker/templates/kaui/latest/Dockerfile.template index 096fad5d..68afb8ce 100644 --- a/docker/templates/kaui/latest/Dockerfile.template +++ b/docker/templates/kaui/latest/Dockerfile.template @@ -15,6 +15,7 @@ COPY ./kaui.sh $KAUI_INSTALL_DIR ENV KPM_INSTALL_CMD="ansible-playbook $ANSIBLE_OPTS \ -e kpm_install_dir=$KPM_INSTALL_DIR \ -e kpm_yml=$KAUI_INSTALL_DIR/kpm.yml \ + -e kaui_kpm_yml=$KAUI_INSTALL_DIR/kpm.yml \ -e tomcat_owner=$TOMCAT_OWNER \ -e tomcat_group=$TOMCAT_GROUP \ -e catalina_base=$CATALINA_BASE \ diff --git a/docker/templates/killbill/latest/Dockerfile.template b/docker/templates/killbill/latest/Dockerfile.template index 4fa5262a..2e4e5740 100644 --- a/docker/templates/killbill/latest/Dockerfile.template +++ b/docker/templates/killbill/latest/Dockerfile.template @@ -27,6 +27,7 @@ COPY ./shiro.ini.template $KILLBILL_INSTALL_DIR/config ENV KPM_INSTALL_CMD="ansible-playbook $ANSIBLE_OPTS \ -e kpm_install_dir=$KPM_INSTALL_DIR \ -e kpm_yml=$KILLBILL_INSTALL_DIR/kpm.yml \ + -e killbill_kpm_yml=$KILLBILL_INSTALL_DIR/kpm.yml \ -e kb_config_dir=$KILLBILL_INSTALL_DIR \ -e kb_plugins_dir=$KILLBILL_INSTALL_DIR/bundles \ -e tomcat_owner=$TOMCAT_OWNER \ @@ -37,6 +38,7 @@ ENV KPM_INSTALL_CMD="ansible-playbook $ANSIBLE_OPTS \ ENV KPM_DIAGNOSTIC_CMD="ansible-playbook $ANSIBLE_OPTS \ -e kpm_install_dir=$KPM_INSTALL_DIR \ -e kpm_yml=$KILLBILL_INSTALL_DIR/kpm.yml \ + -e killbill_kpm_yml=$KILLBILL_INSTALL_DIR/kpm.yml \ -e kb_config_dir=$KILLBILL_INSTALL_DIR \ -e kb_plugins_dir=$KILLBILL_INSTALL_DIR/bundles \ -e tomcat_owner=$TOMCAT_OWNER \ @@ -47,6 +49,7 @@ ENV KPM_DIAGNOSTIC_CMD="ansible-playbook $ANSIBLE_OPTS \ ENV MIGRATIONS_CMD="ansible-playbook $ANSIBLE_OPTS \ -e kpm_install_dir=$KPM_INSTALL_DIR \ -e kpm_yml=$KILLBILL_INSTALL_DIR/kpm.yml \ + -e killbill_kpm_yml=$KILLBILL_INSTALL_DIR/kpm.yml \ -e kb_config_dir=$KILLBILL_INSTALL_DIR \ -e kb_plugins_dir=$KILLBILL_INSTALL_DIR/bundles \ -e flyway_owner=$TOMCAT_OWNER \ From 598fb1c0d97bcde8dede398e743d6d4451bbbc32 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Thu, 29 Jan 2026 10:32:41 +0530 Subject: [PATCH 29/59] Fixed lint errors. --- kpm/spec/kpm/remote/maven_central_api_calls_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kpm/spec/kpm/remote/maven_central_api_calls_spec.rb b/kpm/spec/kpm/remote/maven_central_api_calls_spec.rb index acca9cf2..145d8eee 100644 --- a/kpm/spec/kpm/remote/maven_central_api_calls_spec.rb +++ b/kpm/spec/kpm/remote/maven_central_api_calls_spec.rb @@ -9,7 +9,7 @@ logger.level = Logger::DEBUG logger end - let(:test_version) { '0.24.15' } + let(:test_version) { '0.24.16' } let(:coordinates_map) do { version: test_version, group_id: 'org.kill-bill.billing', From 3c3bf55833f39544b329181bee607caf85093337 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Thu, 29 Jan 2026 10:37:56 +0530 Subject: [PATCH 30/59] Fixed lint errors. --- kpm/spec/kpm/remote/maven_central_api_calls_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kpm/spec/kpm/remote/maven_central_api_calls_spec.rb b/kpm/spec/kpm/remote/maven_central_api_calls_spec.rb index 145d8eee..9307b13f 100644 --- a/kpm/spec/kpm/remote/maven_central_api_calls_spec.rb +++ b/kpm/spec/kpm/remote/maven_central_api_calls_spec.rb @@ -38,7 +38,7 @@ parsed_pom = REXML::Document.new(File.read(destination)) expect(parsed_pom.elements['//groupId'].text).to eq('org.kill-bill.billing') expect(parsed_pom.elements['//artifactId'].text).to eq('killbill-oss-parent') - expect(parsed_pom.elements['//version'].text).to eq('0.146.63') + expect(parsed_pom.elements['//version'].text).to eq('0.146.67') } end From 14a8d2dde4710e08a2eca88af64754171e053332 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Thu, 29 Jan 2026 19:32:08 +0530 Subject: [PATCH 31/59] Added kpm_path env variable to Dockerfile --- ansible/roles/kaui/tasks/main.yml | 3 +-- ansible/roles/killbill/tasks/main.yml | 3 +-- ansible/roles/kpm/tasks/main.yml | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/ansible/roles/kaui/tasks/main.yml b/ansible/roles/kaui/tasks/main.yml index 1d8f32e5..9781055b 100644 --- a/ansible/roles/kaui/tasks/main.yml +++ b/ansible/roles/kaui/tasks/main.yml @@ -81,8 +81,7 @@ # Expand the WAR to speed up startup - name: Expand WAR file if not already done become: true - ansible.builtin.command: | - "{{ java_home }}/bin/jar" -xf ../ROOT.war + ansible.builtin.command: "{{ java_home }}/bin/jar -xf ../ROOT.war" args: chdir: "{{ catalina_base }}/{{ kaui_webapps }}/ROOT" creates: "{{ catalina_base }}/{{ kaui_webapps }}/ROOT/WEB-INF" diff --git a/ansible/roles/killbill/tasks/main.yml b/ansible/roles/killbill/tasks/main.yml index d2993358..22340cdb 100644 --- a/ansible/roles/killbill/tasks/main.yml +++ b/ansible/roles/killbill/tasks/main.yml @@ -96,8 +96,7 @@ # Expand the WAR to speed up startup - name: Expand WAR file if not already done become: true - ansible.builtin.command: | - "{{ java_home }}/bin/jar" -xf ../ROOT.war + ansible.builtin.command: "{{ java_home }}/bin/jar -xf ../ROOT.war" args: chdir: "{{ catalina_base }}/{{ kb_webapps }}/ROOT" creates: "{{ catalina_base }}/{{ kb_webapps }}/ROOT/WEB-INF" diff --git a/ansible/roles/kpm/tasks/main.yml b/ansible/roles/kpm/tasks/main.yml index cf211746..3956e540 100644 --- a/ansible/roles/kpm/tasks/main.yml +++ b/ansible/roles/kpm/tasks/main.yml @@ -106,8 +106,7 @@ # The first time KPM is run, a Gemfile.lock needs to written out - name: Initialize KPM become: true - ansible.builtin.command: | - "{{ kpm_path }}/kpm" version + ansible.builtin.command: "{{ kpm_path }}/kpm version" args: creates: "{{ kpm_path }}/lib/vendor/Gemfile.lock" tags: kpm From 0f78b540c390e0fe7c3a74f4d8a1c2532bdac816 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 11:42:52 +0530 Subject: [PATCH 32/59] Fixed Ansible command error --- docker/templates/base/latest/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/templates/base/latest/Dockerfile b/docker/templates/base/latest/Dockerfile index c73298b3..3a5466b4 100644 --- a/docker/templates/base/latest/Dockerfile +++ b/docker/templates/base/latest/Dockerfile @@ -58,7 +58,7 @@ WORKDIR $TOMCAT_HOME # Install ansible roles dependencies ARG KILLBILL_CLOUD_VERSION RUN ansible-galaxy collection install community.general && \ - ansible-galaxy install git+https://git@github.com/killbill/killbill-cloud.git,$KILLBILL_CLOUD_VERSION + ansible-galaxy install git+https://git@github.com/vnandwana/killbill-cloud.git,$KILLBILL_CLOUD_VERSION ENV KILLBILL_CLOUD_ANSIBLE_ROLES=$TOMCAT_HOME/.ansible/roles/killbill-cloud/ansible ENV ENV_HOST_IP=localhost ENV ANSIBLE_OPTS="-i localhost, \ From 020fa7aaa0176e4e3c668045967bcbd99a60479d Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 11:49:21 +0530 Subject: [PATCH 33/59] Fixed Ansible command error --- ansible/roles/kpm/tasks/main.yml | 12 ++++--- ansible/roles/tomcat/tasks/native.yml | 35 ++++++++++++------- docker/templates/base/latest/Dockerfile | 1 + .../templates/kaui/latest/Dockerfile.template | 1 + .../killbill/latest/Dockerfile.template | 1 + 5 files changed, 34 insertions(+), 16 deletions(-) diff --git a/ansible/roles/kpm/tasks/main.yml b/ansible/roles/kpm/tasks/main.yml index 3956e540..c4e1be5a 100644 --- a/ansible/roles/kpm/tasks/main.yml +++ b/ansible/roles/kpm/tasks/main.yml @@ -65,9 +65,10 @@ - name: Rename noarch KPM directory become: true ansible.builtin.command: - cmd: > - mv {{ kpm_install_dir }}/kpm-{{ kpm_version }}-noarch - {{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }} + argv: + - mv + - "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-noarch" + - "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" creates: "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" when: not kpm_bin.stat.exists and kpm_arch_test.status >= 400 tags: kpm @@ -106,7 +107,10 @@ # The first time KPM is run, a Gemfile.lock needs to written out - name: Initialize KPM become: true - ansible.builtin.command: "{{ kpm_path }}/kpm version" + ansible.builtin.command: + argv: + - "{{ kpm_path }}/kpm" + - version args: creates: "{{ kpm_path }}/lib/vendor/Gemfile.lock" tags: kpm diff --git a/ansible/roles/tomcat/tasks/native.yml b/ansible/roles/tomcat/tasks/native.yml index 1cca7d4b..9ea5b122 100644 --- a/ansible/roles/tomcat/tasks/native.yml +++ b/ansible/roles/tomcat/tasks/native.yml @@ -34,7 +34,10 @@ tags: native - name: Find apr-1-config path - ansible.builtin.command: which apr-1-config + ansible.builtin.command: + argv: + - which + - apr-1-config register: tomcat_apr_config_path_output changed_when: false tags: native @@ -49,7 +52,11 @@ tags: native block: - name: Find tomcat_gnu_arch path - ansible.builtin.command: dpkg-architecture --query DEB_BUILD_GNU_TYPE + ansible.builtin.command: + argv: + - dpkg-architecture + - --query + - DEB_BUILD_GNU_TYPE register: tomcat_gnu_arch_output changed_when: false tags: native @@ -79,21 +86,23 @@ - name: Configure native libraries ansible.builtin.command: - cmd: > - ./configure - --build="{{ tomcat_gnu_arch }}" - --libdir="{{ tomcat_native_libdir }}" - --prefix="{{ catalina_home }}" - --with-apr="{{ tomcat_apr_config_path }}" - --with-java-home="{{ java_home }}" - --with-ssl=yes + argv: + - ./configure + - --build={{ tomcat_gnu_arch }} + - --libdir={{ tomcat_native_libdir }} + - --prefix={{ catalina_home }} + - --with-apr={{ tomcat_apr_config_path }} + - --with-java-home={{ java_home }} + - --with-ssl=yes chdir: "{{ tomcat_workspace.path }}/native" changed_when: false tags: native - name: Build native libraries ansible.builtin.command: - cmd: make all + argv: + - make + - all chdir: "{{ tomcat_workspace.path }}/native" changed_when: false tags: native @@ -101,7 +110,9 @@ - name: Install native libraries become: true ansible.builtin.command: - cmd: make install + argv: + - make + - install chdir: "{{ tomcat_workspace.path }}/native" changed_when: false tags: native diff --git a/docker/templates/base/latest/Dockerfile b/docker/templates/base/latest/Dockerfile index 3a5466b4..382214ff 100644 --- a/docker/templates/base/latest/Dockerfile +++ b/docker/templates/base/latest/Dockerfile @@ -74,6 +74,7 @@ ENV NEXUS_REPOSITORY=${NEXUS_REPOSITORY:-maven2} ENV KPM_INSTALL_DIR=/opt RUN ansible-playbook $ANSIBLE_OPTS \ -e kpm_install_dir=$KPM_INSTALL_DIR \ + -e kpm_path=$KPM_INSTALL_DIR/kpm-latest \ -e kpm_owner=$TOMCAT_OWNER \ -e kpm_group=$TOMCAT_GROUP \ -e nexus_url=$NEXUS_URL \ diff --git a/docker/templates/kaui/latest/Dockerfile.template b/docker/templates/kaui/latest/Dockerfile.template index 68afb8ce..aed4b9f7 100644 --- a/docker/templates/kaui/latest/Dockerfile.template +++ b/docker/templates/kaui/latest/Dockerfile.template @@ -14,6 +14,7 @@ COPY ./kaui.sh $KAUI_INSTALL_DIR ENV KPM_INSTALL_CMD="ansible-playbook $ANSIBLE_OPTS \ -e kpm_install_dir=$KPM_INSTALL_DIR \ + -e kpm_path=$KPM_INSTALL_DIR/kpm-latest \ -e kpm_yml=$KAUI_INSTALL_DIR/kpm.yml \ -e kaui_kpm_yml=$KAUI_INSTALL_DIR/kpm.yml \ -e tomcat_owner=$TOMCAT_OWNER \ diff --git a/docker/templates/killbill/latest/Dockerfile.template b/docker/templates/killbill/latest/Dockerfile.template index 2e4e5740..9cef6512 100644 --- a/docker/templates/killbill/latest/Dockerfile.template +++ b/docker/templates/killbill/latest/Dockerfile.template @@ -26,6 +26,7 @@ COPY ./shiro.ini.template $KILLBILL_INSTALL_DIR/config ENV KPM_INSTALL_CMD="ansible-playbook $ANSIBLE_OPTS \ -e kpm_install_dir=$KPM_INSTALL_DIR \ + -e kpm_path=$KPM_INSTALL_DIR/kpm-latest \ -e kpm_yml=$KILLBILL_INSTALL_DIR/kpm.yml \ -e killbill_kpm_yml=$KILLBILL_INSTALL_DIR/kpm.yml \ -e kb_config_dir=$KILLBILL_INSTALL_DIR \ From 2d75ce0b61a466977e8941278c2dff504edd69e1 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 11:58:00 +0530 Subject: [PATCH 34/59] Fixed Ansible command error --- docker/templates/killbill/latest/Dockerfile.template | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/templates/killbill/latest/Dockerfile.template b/docker/templates/killbill/latest/Dockerfile.template index 9cef6512..7a4715de 100644 --- a/docker/templates/killbill/latest/Dockerfile.template +++ b/docker/templates/killbill/latest/Dockerfile.template @@ -38,6 +38,7 @@ ENV KPM_INSTALL_CMD="ansible-playbook $ANSIBLE_OPTS \ ENV KPM_DIAGNOSTIC_CMD="ansible-playbook $ANSIBLE_OPTS \ -e kpm_install_dir=$KPM_INSTALL_DIR \ + -e kpm_path=$KPM_INSTALL_DIR/kpm-latest \ -e kpm_yml=$KILLBILL_INSTALL_DIR/kpm.yml \ -e killbill_kpm_yml=$KILLBILL_INSTALL_DIR/kpm.yml \ -e kb_config_dir=$KILLBILL_INSTALL_DIR \ From d7ab1e075177b4444c9dc9a6505cd1bf5aedeb90 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 12:06:12 +0530 Subject: [PATCH 35/59] Fixed Ansible command error --- ansible/roles/common/tasks/main.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml index a134f58d..2f92b483 100644 --- a/ansible/roles/common/tasks/main.yml +++ b/ansible/roles/common/tasks/main.yml @@ -1,7 +1,4 @@ --- -- name: Setup Ansible ruby interpreter - ansible.builtin.set_fact: - ansible_ruby_interpreter: "{{ kpm_path }}/lib/ruby/bin/ruby" +- name: ansible_ruby_interpreter setup + set_fact: ansible_ruby_interpreter="{{ kpm_path }}/lib/ruby/bin/ruby" tags: common -# noqa: var-naming[no-role-prefix] -# Required for ansible-lint: variable must stay named 'ansible_ruby_interpreter' for Ansible to pick it up \ No newline at end of file From fc6129ad17a98586de091fd956260d12e26978a4 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 12:15:17 +0530 Subject: [PATCH 36/59] Fixed Ansible command error --- ansible/roles/killbill/tasks/main.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ansible/roles/killbill/tasks/main.yml b/ansible/roles/killbill/tasks/main.yml index 22340cdb..692665ab 100644 --- a/ansible/roles/killbill/tasks/main.yml +++ b/ansible/roles/killbill/tasks/main.yml @@ -96,7 +96,11 @@ # Expand the WAR to speed up startup - name: Expand WAR file if not already done become: true - ansible.builtin.command: "{{ java_home }}/bin/jar -xf ../ROOT.war" + ansible.builtin.command: + argv: + - "{{ java_home }}/bin/jar" + - -xf + - ../ROOT.war args: chdir: "{{ catalina_base }}/{{ kb_webapps }}/ROOT" creates: "{{ catalina_base }}/{{ kb_webapps }}/ROOT/WEB-INF" From e124e736882a4ee47e9ecf916faa1b7f0cf06c2a Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 12:22:08 +0530 Subject: [PATCH 37/59] Fixed Ansible command error --- ansible/roles/common/tasks/main.yml | 7 +++++-- ansible/roles/kaui/tasks/main.yml | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml index 2f92b483..a134f58d 100644 --- a/ansible/roles/common/tasks/main.yml +++ b/ansible/roles/common/tasks/main.yml @@ -1,4 +1,7 @@ --- -- name: ansible_ruby_interpreter setup - set_fact: ansible_ruby_interpreter="{{ kpm_path }}/lib/ruby/bin/ruby" +- name: Setup Ansible ruby interpreter + ansible.builtin.set_fact: + ansible_ruby_interpreter: "{{ kpm_path }}/lib/ruby/bin/ruby" tags: common +# noqa: var-naming[no-role-prefix] +# Required for ansible-lint: variable must stay named 'ansible_ruby_interpreter' for Ansible to pick it up \ No newline at end of file diff --git a/ansible/roles/kaui/tasks/main.yml b/ansible/roles/kaui/tasks/main.yml index 9781055b..05dba8dd 100644 --- a/ansible/roles/kaui/tasks/main.yml +++ b/ansible/roles/kaui/tasks/main.yml @@ -81,7 +81,11 @@ # Expand the WAR to speed up startup - name: Expand WAR file if not already done become: true - ansible.builtin.command: "{{ java_home }}/bin/jar -xf ../ROOT.war" + ansible.builtin.command: + argv: + - "{{ java_home }}/bin/jar" + - -xf + - ../ROOT.war args: chdir: "{{ catalina_base }}/{{ kaui_webapps }}/ROOT" creates: "{{ catalina_base }}/{{ kaui_webapps }}/ROOT/WEB-INF" From e18a2b76c8345495c71047d1b392480a6722c093 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 12:33:15 +0530 Subject: [PATCH 38/59] Fixed Ansible command error --- ansible/roles/killbill/tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/roles/killbill/tasks/main.yml b/ansible/roles/killbill/tasks/main.yml index 692665ab..1921c499 100644 --- a/ansible/roles/killbill/tasks/main.yml +++ b/ansible/roles/killbill/tasks/main.yml @@ -60,7 +60,7 @@ - name: Check if a ROOT webapp is already installed ansible.builtin.stat: path: "{{ catalina_base }}/{{ kb_webapps }}/ROOT" - register: killbill_existing_webapp + register: existing_webapp tags: tomcat # Only run kpm install if there is no exploded webapp already. Otherwise, @@ -73,8 +73,8 @@ become_user: "{{ tomcat_owner }}" killbill: kpm_path: "{{ kpm_path }}" - kpm_yml: "{{ killbill_kpm_yml }}" - when: not killbill_existing_webapp.stat.exists + kpm_yml: "{{ kpm_yml }}" + when: not existing_webapp.stat.exists tags: kpm-install - name: Set correct permissions From c1695d71854cbcd99a954d8482e20a8aebee4fe3 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 14:11:03 +0530 Subject: [PATCH 39/59] Fixed Ansible command error --- ansible/roles/kaui/tasks/json_logging.yml | 1 - ansible/roles/kaui/tasks/main.yml | 7 ++----- ansible/roles/killbill/tasks/main.yml | 7 ++----- ansible/roles/kpm/tasks/main.yml | 15 +++------------ 4 files changed, 7 insertions(+), 23 deletions(-) diff --git a/ansible/roles/kaui/tasks/json_logging.yml b/ansible/roles/kaui/tasks/json_logging.yml index 76d4a336..84cf3a2e 100644 --- a/ansible/roles/kaui/tasks/json_logging.yml +++ b/ansible/roles/kaui/tasks/json_logging.yml @@ -4,7 +4,6 @@ ansible.builtin.get_url: url: "{{ nexus_url }}/{{ nexus_repository }}/{{ item.group_path }}/{{ item.artifact_id }}/{{ item.version }}/{{ item.artifact_id }}-{{ item.version }}.jar" dest: "{{ item.dest }}" - mode: '0644' with_items: - group_path: com/fasterxml/jackson/core artifact_id: jackson-databind diff --git a/ansible/roles/kaui/tasks/main.yml b/ansible/roles/kaui/tasks/main.yml index 05dba8dd..301a3495 100644 --- a/ansible/roles/kaui/tasks/main.yml +++ b/ansible/roles/kaui/tasks/main.yml @@ -81,11 +81,8 @@ # Expand the WAR to speed up startup - name: Expand WAR file if not already done become: true - ansible.builtin.command: - argv: - - "{{ java_home }}/bin/jar" - - -xf - - ../ROOT.war + command: | + "{{ java_home }}/bin/jar" -xf ../ROOT.war args: chdir: "{{ catalina_base }}/{{ kaui_webapps }}/ROOT" creates: "{{ catalina_base }}/{{ kaui_webapps }}/ROOT/WEB-INF" diff --git a/ansible/roles/killbill/tasks/main.yml b/ansible/roles/killbill/tasks/main.yml index 1921c499..cf2d3eca 100644 --- a/ansible/roles/killbill/tasks/main.yml +++ b/ansible/roles/killbill/tasks/main.yml @@ -96,11 +96,8 @@ # Expand the WAR to speed up startup - name: Expand WAR file if not already done become: true - ansible.builtin.command: - argv: - - "{{ java_home }}/bin/jar" - - -xf - - ../ROOT.war + command: | + "{{ java_home }}/bin/jar" -xf ../ROOT.war args: chdir: "{{ catalina_base }}/{{ kb_webapps }}/ROOT" creates: "{{ catalina_base }}/{{ kb_webapps }}/ROOT/WEB-INF" diff --git a/ansible/roles/kpm/tasks/main.yml b/ansible/roles/kpm/tasks/main.yml index c4e1be5a..efd3f5dd 100644 --- a/ansible/roles/kpm/tasks/main.yml +++ b/ansible/roles/kpm/tasks/main.yml @@ -46,7 +46,6 @@ dest: "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-noarch.tar.gz" owner: "{{ kpm_owner }}" group: "{{ kpm_group }}" - mode: '0644' when: not kpm_bin.stat.exists and kpm_arch_test.status >= 400 tags: kpm @@ -64,12 +63,7 @@ # To make things easier - name: Rename noarch KPM directory become: true - ansible.builtin.command: - argv: - - mv - - "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-noarch" - - "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" - creates: "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" + command: "mv {{ kpm_install_dir }}/kpm-{{ kpm_version }}-noarch {{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" when: not kpm_bin.stat.exists and kpm_arch_test.status >= 400 tags: kpm @@ -81,7 +75,6 @@ dest: "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}.tar.gz" owner: "{{ kpm_owner }}" group: "{{ kpm_group }}" - mode: '0644' when: not kpm_bin.stat.exists and kpm_arch_test.status < 400 tags: kpm @@ -107,10 +100,8 @@ # The first time KPM is run, a Gemfile.lock needs to written out - name: Initialize KPM become: true - ansible.builtin.command: - argv: - - "{{ kpm_path }}/kpm" - - version + command: | + "{{ kpm_path }}/kpm" version args: creates: "{{ kpm_path }}/lib/vendor/Gemfile.lock" tags: kpm From 72962e9dc47a4495e81067d75ebf292862b139af Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 14:25:27 +0530 Subject: [PATCH 40/59] Fixed Ansible command error --- ansible/group_vars/all.yml | 5 +- ansible/roles/common/tasks/main.yml | 7 +- ansible/roles/kaui/tasks/json_logging.yml | 9 +- ansible/roles/kaui/tasks/main.yml | 19 +- ansible/roles/killbill/tasks/main.yml | 13 +- ansible/roles/kpm/tasks/main.yml | 11 +- ansible/roles/migrations/tasks/flyway.yml | 29 +-- ansible/roles/tomcat/tasks/install.yml | 11 +- ansible/roles/tomcat/tasks/json_logging.yml | 1 - ansible/roles/tomcat/tasks/main.yml | 7 +- ansible/roles/tomcat/tasks/native.yml | 199 +++++++++----------- 11 files changed, 114 insertions(+), 197 deletions(-) diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 1b562916..1eaeccb4 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -28,16 +28,13 @@ kb_config_dir: "{{ kb_install_dir }}/config" kb_plugins_dir: "{{ kb_install_dir }}/bundles" # kpm.yml file kpm_yml: "{{ kb_install_dir }}/kpm.yml" -killbill_kpm_yml: "{{ kb_install_dir }}/kpm.yml" -kaui_kpm_yml: "{{ kb_install_dir }}/kpm.yml" kaui_install_dir: /var/lib/kaui # For consistency as to where the sha1.yml is located kaui_plugins_dir: "{{ kaui_install_dir }}/bundles" flyway_install_dir: /opt -flyway: java -jar {{ flyway_install_dir }}/killbill-flyway.jar -url='{{ lookup('env', 'KILLBILL_DAO_URL') }}' -user={{ lookup('env', 'KILLBILL_DAO_USER') }} -password={{ lookup('env', 'KILLBILL_DAO_PASSWORD') }} - +flyway: java -jar {{ flyway_install_dir }}/killbill-flyway.jar -url='{{ lookup('env','KILLBILL_DAO_URL') }}' -user={{ lookup('env','KILLBILL_DAO_USER') }} -password={{ lookup('env','KILLBILL_DAO_PASSWORD') }} flyway_owner: root flyway_group: root diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml index a134f58d..2f92b483 100644 --- a/ansible/roles/common/tasks/main.yml +++ b/ansible/roles/common/tasks/main.yml @@ -1,7 +1,4 @@ --- -- name: Setup Ansible ruby interpreter - ansible.builtin.set_fact: - ansible_ruby_interpreter: "{{ kpm_path }}/lib/ruby/bin/ruby" +- name: ansible_ruby_interpreter setup + set_fact: ansible_ruby_interpreter="{{ kpm_path }}/lib/ruby/bin/ruby" tags: common -# noqa: var-naming[no-role-prefix] -# Required for ansible-lint: variable must stay named 'ansible_ruby_interpreter' for Ansible to pick it up \ No newline at end of file diff --git a/ansible/roles/kaui/tasks/json_logging.yml b/ansible/roles/kaui/tasks/json_logging.yml index 84cf3a2e..46b114ac 100644 --- a/ansible/roles/kaui/tasks/json_logging.yml +++ b/ansible/roles/kaui/tasks/json_logging.yml @@ -24,10 +24,7 @@ - name: Set correct permissions become: true - ansible.builtin.file: - path: "/opt/{{ item.name }}" - owner: "{{ tomcat_owner }}" - group: "{{ tomcat_group }}" + file: path=/opt/{{ item.name }} owner={{ tomcat_owner }} group={{ tomcat_group }} with_items: - name: jackson-databind.jar - name: jackson-core.jar @@ -36,8 +33,8 @@ - kaui-logback - logstash -- name: Ensure Logstash third-party dependencies exist in the webapp - ansible.builtin.copy: +- name: ensure Logstash third-party dependencies exist in the webapp + copy: src: "/opt/{{ item.name }}" dest: "{{ catalina_base }}/webapps/ROOT/WEB-INF/lib/{{ item.name }}" owner: "{{ tomcat_owner }}" diff --git a/ansible/roles/kaui/tasks/main.yml b/ansible/roles/kaui/tasks/main.yml index 301a3495..e8f49cc1 100644 --- a/ansible/roles/kaui/tasks/main.yml +++ b/ansible/roles/kaui/tasks/main.yml @@ -1,12 +1,7 @@ --- - name: Ensure Kaui dirs exist become: true - ansible.builtin.file: - path: "{{ item }}" - state: directory - owner: "{{ tomcat_owner }}" - group: "{{ tomcat_group }}" - mode: u=rwx,g=rx,o=rx + file: path={{ item }} state=directory owner={{ tomcat_owner }} group={{ tomcat_group }} mode=u=rwx,g=rx,o=rx with_items: - "{{ kaui_install_dir }}" - "{{ kaui_plugins_dir }}" @@ -45,7 +40,7 @@ - name: Check if a ROOT webapp is already installed ansible.builtin.stat: path: "{{ catalina_base }}/{{ kaui_webapps }}/ROOT" - register: kaui_existing_webapp + register: existing_webapp tags: tomcat # Only run kpm install if there is no exploded webapp already. Otherwise, @@ -58,17 +53,13 @@ become_user: "{{ tomcat_owner }}" killbill: kpm_path: "{{ kpm_path }}" - kpm_yml: "{{ kaui_kpm_yml }}" - when: not kaui_existing_webapp.stat.exists + kpm_yml: "{{ kpm_yml }}" + when: not existing_webapp.stat.exists tags: kpm-install - name: Set correct permissions become: true - ansible.builtin.file: - path: "{{ kaui_install_dir }}" - owner: "{{ tomcat_owner }}" - group: "{{ tomcat_group }}" - recurse: yes + file: path={{ kaui_install_dir }} owner={{ tomcat_owner }} group={{ tomcat_group }} recurse=yes tags: kpm-install - name: Create ROOT directory to unarchive the WAR diff --git a/ansible/roles/killbill/tasks/main.yml b/ansible/roles/killbill/tasks/main.yml index cf2d3eca..ac0ba42a 100644 --- a/ansible/roles/killbill/tasks/main.yml +++ b/ansible/roles/killbill/tasks/main.yml @@ -1,12 +1,7 @@ --- - name: Ensure Kill Bill dirs exist become: true - ansible.builtin.file: - path: "{{ item }}" - state: directory - owner: "{{ tomcat_owner }}" - group: "{{ tomcat_group }}" - mode: u=rwx,g=rx,o=rx + file: path={{ item }} state=directory owner={{ tomcat_owner }} group={{ tomcat_group }} mode=u=rwx,g=rx,o=rx with_items: - "{{ kb_config_dir }}" - "{{ kb_plugins_dir }}" @@ -79,11 +74,7 @@ - name: Set correct permissions become: true - ansible.builtin.file: - path: "{{ kb_install_dir }}" - owner: "{{ tomcat_owner }}" - group: "{{ tomcat_group }}" - recurse: yes + file: path={{ kb_install_dir }} owner={{ tomcat_owner }} group={{ tomcat_group }} recurse=yes tags: kpm-install - name: Create ROOT directory to unarchive the WAR diff --git a/ansible/roles/kpm/tasks/main.yml b/ansible/roles/kpm/tasks/main.yml index efd3f5dd..09bf690b 100644 --- a/ansible/roles/kpm/tasks/main.yml +++ b/ansible/roles/kpm/tasks/main.yml @@ -91,10 +91,7 @@ - name: Symlink install directory become: true - ansible.builtin.file: - src: "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" - path: "{{ kpm_path }}" - state: link + file: src="{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" path="{{ kpm_path }}" state=link tags: kpm # The first time KPM is run, a Gemfile.lock needs to written out @@ -109,9 +106,5 @@ # The individual files have the correct permissions already, but not the top directory - name: Set correct permissions become: true - ansible.builtin.file: - path: "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" - owner: "{{ kpm_owner }}" - group: "{{ kpm_group }}" - recurse: yes + file: path="{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" owner={{ kpm_owner }} group={{ kpm_group }} recurse=yes tags: kpm diff --git a/ansible/roles/migrations/tasks/flyway.yml b/ansible/roles/migrations/tasks/flyway.yml index d3165661..83617e75 100644 --- a/ansible/roles/migrations/tasks/flyway.yml +++ b/ansible/roles/migrations/tasks/flyway.yml @@ -1,36 +1,29 @@ --- - name: Ensure Flyway install dir exists become: true - ansible.builtin.file: - path: "{{ flyway_install_dir }}" - state: directory - mode: u=rwx,g=rx,o=rx + file: path={{ flyway_install_dir }} state=directory mode=u=rwx,g=rx,o=rx tags: migrations # Note: we don't check the version but the binary is rarely updated - name: Check if Flyway is already installed ansible.builtin.stat: path: "{{ flyway_install_dir }}/killbill-flyway.jar" - register: migrations_flyway_bin - tags: migrations - -- name: Download Kill Bill Flyway metadata - when: not migrations_flyway_bin.stat.exists + register: flyway_bin tags: migrations block: - name: Download killbill-flyway release metadata ansible.builtin.uri: url: "{{ nexus_url }}/{{ nexus_repository }}/org/kill-bill/billing/killbill-util/maven-metadata.xml" return_content: yes - register: migrations_flyway_metadata - when: migrations_flyway_version is undefined + register: flyway_metadata + when: flyway_version is undefined tags: migrations # We don't use the xml module to avoid a dependency on lxml - - name: Set migrations_flyway_version - ansible.builtin.set_fact: - migrations_flyway_version: "{{ migrations_flyway_metadata.content | regex_search('(.*)', '\\1') | first }}" - when: migrations_flyway_version is undefined + - name: set flyway_version + set_fact: + flyway_version: "{{ flyway_metadata.content | regex_search('(.*)', '\\1') | first }}" + when: flyway_version is undefined tags: migrations - name: Install Flyway @@ -39,14 +32,10 @@ ansible.builtin.get_url: url: "{{ nexus_url }}/{{ nexus_repository }}/org/kill-bill/billing/killbill-util/{{ migrations_flyway_version }}/killbill-util-{{ migrations_flyway_version }}-flyway.jar" dest: "{{ flyway_install_dir }}/killbill-flyway.jar" - mode: '0644' tags: migrations - name: Set correct permissions become: true - ansible.builtin.file: - path: "{{ flyway_install_dir }}/killbill-flyway.jar" - owner: "{{ flyway_owner }}" - group: "{{ flyway_group }}" + file: path="{{ flyway_install_dir }}/killbill-flyway.jar" owner={{ flyway_owner }} group={{ flyway_group }} tags: migrations diff --git a/ansible/roles/tomcat/tasks/install.yml b/ansible/roles/tomcat/tasks/install.yml index 08fad0ed..b7f941dc 100644 --- a/ansible/roles/tomcat/tasks/install.yml +++ b/ansible/roles/tomcat/tasks/install.yml @@ -55,19 +55,12 @@ # The individual files have the correct permissions already, but not the top directory - name: Set correct permissions become: true - ansible.builtin.file: - path: "{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" - owner: "{{ tomcat_owner }}" - group: "{{ tomcat_group }}" - recurse: yes + file: path="{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" owner={{ tomcat_owner }} group={{ tomcat_group }} recurse=yes tags: install - name: Symlink install directory become: true - ansible.builtin.file: - src: "{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" - path: "{{ catalina_home }}" - state: link + file: src="{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" path="{{ catalina_home }}" state=link tags: install - name: Set required Tomcat environment variables diff --git a/ansible/roles/tomcat/tasks/json_logging.yml b/ansible/roles/tomcat/tasks/json_logging.yml index e5f70b22..4530a4d2 100644 --- a/ansible/roles/tomcat/tasks/json_logging.yml +++ b/ansible/roles/tomcat/tasks/json_logging.yml @@ -4,7 +4,6 @@ ansible.builtin.get_url: url: "{{ nexus_url }}/{{ nexus_repository }}/net/logstash/logback/logstash-logback-encoder/6.4/logstash-logback-encoder-6.4.jar" dest: /opt/logstash-logback-encoder.jar - mode: '0644' tags: - killbill-logback - logstash diff --git a/ansible/roles/tomcat/tasks/main.yml b/ansible/roles/tomcat/tasks/main.yml index ee2c4285..5f97e5d8 100644 --- a/ansible/roles/tomcat/tasks/main.yml +++ b/ansible/roles/tomcat/tasks/main.yml @@ -1,12 +1,7 @@ --- - name: Ensure Tomcat dirs exist become: true - ansible.builtin.file: - path: "{{ catalina_base }}/{{ item }}" - state: directory - owner: "{{ tomcat_owner }}" - group: "{{ tomcat_group }}" - mode: u=rwx,g=rx,o=rx + file: path={{ catalina_base }}/{{ item }} state=directory owner={{ tomcat_owner }} group={{ tomcat_group }} mode=u=rwx,g=rx,o=rx with_items: - bin - conf diff --git a/ansible/roles/tomcat/tasks/native.yml b/ansible/roles/tomcat/tasks/native.yml index 9ea5b122..22f04a92 100644 --- a/ansible/roles/tomcat/tasks/native.yml +++ b/ansible/roles/tomcat/tasks/native.yml @@ -1,133 +1,108 @@ --- -- name: Set tomcat_native_libdir - ansible.builtin.set_fact: +- name: set tomcat_native_libdir + set_fact: tomcat_native_libdir: "{{ catalina_home }}/native-jni-lib" when: tomcat_native_libdir is undefined tags: native -- name: Check if native libaries are already built - ansible.builtin.stat: +- name: check if native libaries are already built + stat: path: "{{ tomcat_native_libdir }}/libtcnative-1.so" - register: tomcat_libtcnative + register: libtcnative tags: native -- name: Build Tomcat native libraries - when: not tomcat_libtcnative.stat.exists - tags: native - block: - - - name: Prepare build toolchain - when: tomcat_apr_config_path is undefined +- block: + - block: + - name: install toolchain + become: true + package: > + name={{ item }} + state=latest + with_items: + - dpkg-dev + - gcc + - libapr1-dev + - libssl-dev + - make tags: native - block: - - name: Install toolchain - become: true - ansible.builtin.package: - name: "{{ item }}" - state: present - with_items: - - dpkg-dev - - gcc - - libapr1-dev - - libssl-dev - - make - tags: native - - - name: Find apr-1-config path - ansible.builtin.command: - argv: - - which - - apr-1-config - register: tomcat_apr_config_path_output - changed_when: false - tags: native - - name: Set tomcat_apr_config_path - ansible.builtin.set_fact: - tomcat_apr_config_path: "{{ tomcat_apr_config_path_output.stdout }}" - tags: native - - - name: Detect GNU architecture - when: tomcat_gnu_arch is undefined + - name: find apr-1-config path + shell: which apr-1-config + register: apr_config_path_output tags: native - block: - - name: Find tomcat_gnu_arch path - ansible.builtin.command: - argv: - - dpkg-architecture - - --query - - DEB_BUILD_GNU_TYPE - register: tomcat_gnu_arch_output - changed_when: false - tags: native - - - name: Set tomcat_gnu_arch - ansible.builtin.set_fact: - tomcat_gnu_arch: "{{ tomcat_gnu_arch_output.stdout }}" - tags: native - - name: Create temporary build directory - ansible.builtin.tempfile: - state: directory - suffix: tomcat-native-build - register: tomcat_workspace + - name: set apr_config_path + set_fact: + apr_config_path: "{{ apr_config_path_output.stdout }}" tags: native + when: apr_config_path is undefined + tags: native - # become: true needed here as the user SSH'ing in might not be able to open /usr/share/tomcat/bin - - name: Expand native libraries archive - become: true - ansible.builtin.unarchive: - src: "{{ catalina_home }}/bin/tomcat-native.tar.gz" - dest: "{{ tomcat_workspace.path }}" - extra_opts: [--strip-components=1] - owner: "{{ ansible_user_id }}" - remote_src: yes + - block: + - name: find gnu_arch path + shell: dpkg-architecture --query DEB_BUILD_GNU_TYPE + register: gnu_arch_output tags: native - - name: Configure native libraries - ansible.builtin.command: - argv: - - ./configure - - --build={{ tomcat_gnu_arch }} - - --libdir={{ tomcat_native_libdir }} - - --prefix={{ catalina_home }} - - --with-apr={{ tomcat_apr_config_path }} - - --with-java-home={{ java_home }} - - --with-ssl=yes - chdir: "{{ tomcat_workspace.path }}/native" - changed_when: false + - name: set gnu_arch + set_fact: + gnu_arch: "{{ gnu_arch_output.stdout }}" tags: native + when: gnu_arch is undefined + tags: native - - name: Build native libraries - ansible.builtin.command: - argv: - - make - - all - chdir: "{{ tomcat_workspace.path }}/native" - changed_when: false - tags: native + - name: create temporary build directory + tempfile: + state: directory + suffix: tomcat-native-build + register: workspace + tags: native - - name: Install native libraries - become: true - ansible.builtin.command: - argv: - - make - - install - chdir: "{{ tomcat_workspace.path }}/native" - changed_when: false - tags: native + # become: true needed here as the user SSH'ing in might not be able to open /usr/share/tomcat/bin + - name: expand native libraries archive + become: true + unarchive: + src: "{{ catalina_home }}/bin/tomcat-native.tar.gz" + dest: "{{ workspace.path }}" + extra_opts: [--strip-components=1] + owner: "{{ ansible_user_id }}" + remote_src: yes + tags: native - - name: Set correct permissions - become: true - ansible.builtin.file: - path: "{{ tomcat_native_libdir }}" - owner: "{{ tomcat_owner }}" - group: "{{ tomcat_group }}" - recurse: yes - tags: install + - name: configure native libraries + command: > + ./configure + --build="{{ gnu_arch }}" + --libdir="{{ tomcat_native_libdir }}" + --prefix="{{ catalina_home }}" + --with-apr="{{ apr_config_path }}" + --with-java-home="{{ java_home }}" + --with-ssl=yes + chdir="{{ workspace.path }}/native" + tags: native - - name: Remove temporary directory - ansible.builtin.file: - path: "{{ tomcat_workspace.path }}" - state: absent - tags: native + - name: build native libraries + command: > + make all + chdir="{{ workspace.path }}/native" + tags: native + + - name: install native libraries + become: true + command: > + make install + chdir="{{ workspace.path }}/native" + tags: native + + - name: set correct permissions + become: true + file: path={{ tomcat_native_libdir }} owner={{ tomcat_owner }} group={{ tomcat_group }} recurse=yes + tags: install + + - name: remove temporary directory + file: + path="{{ workspace.path }}" + state=absent + tags: native + when: not libtcnative.stat.exists + tags: native From e2f5b32b0ee1380046fb861fc74d4f0aed012445 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 15:43:44 +0530 Subject: [PATCH 41/59] Fixed Ansible command error --- .github/workflows/docker_ci.yml | 4 ++-- ansible/group_vars/all.yml | 5 ++++- ansible/roles/common/tasks/main.yml | 7 +++++-- ansible/roles/kaui/tasks/json_logging.yml | 9 ++++++--- ansible/roles/kaui/tasks/main.yml | 13 +++++++++++-- ansible/roles/killbill/tasks/main.yml | 13 +++++++++++-- ansible/roles/kpm/tasks/main.yml | 11 +++++++++-- ansible/roles/migrations/tasks/flyway.yml | 10 ++++++++-- ansible/roles/tomcat/tasks/install.yml | 11 +++++++++-- ansible/roles/tomcat/tasks/main.yml | 7 ++++++- .../templates/killbill/latest/Dockerfile.template | 1 + 11 files changed, 72 insertions(+), 19 deletions(-) diff --git a/.github/workflows/docker_ci.yml b/.github/workflows/docker_ci.yml index b56fbec3..04574c57 100644 --- a/.github/workflows/docker_ci.yml +++ b/.github/workflows/docker_ci.yml @@ -8,8 +8,8 @@ on: env: # Doesn't matter too much, we just want to verify the build passes CURRENT_LTS: '0.24' - KB_VERSION: '0.24.15' - KAUI_VERSION: '3.0.20' + KB_VERSION: '0.24.16' + KAUI_VERSION: '4.0.6' jobs: docker_ci: diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 1eaeccb4..1b562916 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -28,13 +28,16 @@ kb_config_dir: "{{ kb_install_dir }}/config" kb_plugins_dir: "{{ kb_install_dir }}/bundles" # kpm.yml file kpm_yml: "{{ kb_install_dir }}/kpm.yml" +killbill_kpm_yml: "{{ kb_install_dir }}/kpm.yml" +kaui_kpm_yml: "{{ kb_install_dir }}/kpm.yml" kaui_install_dir: /var/lib/kaui # For consistency as to where the sha1.yml is located kaui_plugins_dir: "{{ kaui_install_dir }}/bundles" flyway_install_dir: /opt -flyway: java -jar {{ flyway_install_dir }}/killbill-flyway.jar -url='{{ lookup('env','KILLBILL_DAO_URL') }}' -user={{ lookup('env','KILLBILL_DAO_USER') }} -password={{ lookup('env','KILLBILL_DAO_PASSWORD') }} +flyway: java -jar {{ flyway_install_dir }}/killbill-flyway.jar -url='{{ lookup('env', 'KILLBILL_DAO_URL') }}' -user={{ lookup('env', 'KILLBILL_DAO_USER') }} -password={{ lookup('env', 'KILLBILL_DAO_PASSWORD') }} + flyway_owner: root flyway_group: root diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml index 2f92b483..a134f58d 100644 --- a/ansible/roles/common/tasks/main.yml +++ b/ansible/roles/common/tasks/main.yml @@ -1,4 +1,7 @@ --- -- name: ansible_ruby_interpreter setup - set_fact: ansible_ruby_interpreter="{{ kpm_path }}/lib/ruby/bin/ruby" +- name: Setup Ansible ruby interpreter + ansible.builtin.set_fact: + ansible_ruby_interpreter: "{{ kpm_path }}/lib/ruby/bin/ruby" tags: common +# noqa: var-naming[no-role-prefix] +# Required for ansible-lint: variable must stay named 'ansible_ruby_interpreter' for Ansible to pick it up \ No newline at end of file diff --git a/ansible/roles/kaui/tasks/json_logging.yml b/ansible/roles/kaui/tasks/json_logging.yml index 46b114ac..84cf3a2e 100644 --- a/ansible/roles/kaui/tasks/json_logging.yml +++ b/ansible/roles/kaui/tasks/json_logging.yml @@ -24,7 +24,10 @@ - name: Set correct permissions become: true - file: path=/opt/{{ item.name }} owner={{ tomcat_owner }} group={{ tomcat_group }} + ansible.builtin.file: + path: "/opt/{{ item.name }}" + owner: "{{ tomcat_owner }}" + group: "{{ tomcat_group }}" with_items: - name: jackson-databind.jar - name: jackson-core.jar @@ -33,8 +36,8 @@ - kaui-logback - logstash -- name: ensure Logstash third-party dependencies exist in the webapp - copy: +- name: Ensure Logstash third-party dependencies exist in the webapp + ansible.builtin.copy: src: "/opt/{{ item.name }}" dest: "{{ catalina_base }}/webapps/ROOT/WEB-INF/lib/{{ item.name }}" owner: "{{ tomcat_owner }}" diff --git a/ansible/roles/kaui/tasks/main.yml b/ansible/roles/kaui/tasks/main.yml index e8f49cc1..2c167c5e 100644 --- a/ansible/roles/kaui/tasks/main.yml +++ b/ansible/roles/kaui/tasks/main.yml @@ -1,7 +1,12 @@ --- - name: Ensure Kaui dirs exist become: true - file: path={{ item }} state=directory owner={{ tomcat_owner }} group={{ tomcat_group }} mode=u=rwx,g=rx,o=rx + ansible.builtin.file: + path: "{{ item }}" + state: directory + owner: "{{ tomcat_owner }}" + group: "{{ tomcat_group }}" + mode: u=rwx,g=rx,o=rx with_items: - "{{ kaui_install_dir }}" - "{{ kaui_plugins_dir }}" @@ -59,7 +64,11 @@ - name: Set correct permissions become: true - file: path={{ kaui_install_dir }} owner={{ tomcat_owner }} group={{ tomcat_group }} recurse=yes + ansible.builtin.file: + path: "{{ kaui_install_dir }}" + owner: "{{ tomcat_owner }}" + group: "{{ tomcat_group }}" + recurse: yes tags: kpm-install - name: Create ROOT directory to unarchive the WAR diff --git a/ansible/roles/killbill/tasks/main.yml b/ansible/roles/killbill/tasks/main.yml index ac0ba42a..cf2d3eca 100644 --- a/ansible/roles/killbill/tasks/main.yml +++ b/ansible/roles/killbill/tasks/main.yml @@ -1,7 +1,12 @@ --- - name: Ensure Kill Bill dirs exist become: true - file: path={{ item }} state=directory owner={{ tomcat_owner }} group={{ tomcat_group }} mode=u=rwx,g=rx,o=rx + ansible.builtin.file: + path: "{{ item }}" + state: directory + owner: "{{ tomcat_owner }}" + group: "{{ tomcat_group }}" + mode: u=rwx,g=rx,o=rx with_items: - "{{ kb_config_dir }}" - "{{ kb_plugins_dir }}" @@ -74,7 +79,11 @@ - name: Set correct permissions become: true - file: path={{ kb_install_dir }} owner={{ tomcat_owner }} group={{ tomcat_group }} recurse=yes + ansible.builtin.file: + path: "{{ kb_install_dir }}" + owner: "{{ tomcat_owner }}" + group: "{{ tomcat_group }}" + recurse: yes tags: kpm-install - name: Create ROOT directory to unarchive the WAR diff --git a/ansible/roles/kpm/tasks/main.yml b/ansible/roles/kpm/tasks/main.yml index 09bf690b..efd3f5dd 100644 --- a/ansible/roles/kpm/tasks/main.yml +++ b/ansible/roles/kpm/tasks/main.yml @@ -91,7 +91,10 @@ - name: Symlink install directory become: true - file: src="{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" path="{{ kpm_path }}" state=link + ansible.builtin.file: + src: "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" + path: "{{ kpm_path }}" + state: link tags: kpm # The first time KPM is run, a Gemfile.lock needs to written out @@ -106,5 +109,9 @@ # The individual files have the correct permissions already, but not the top directory - name: Set correct permissions become: true - file: path="{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" owner={{ kpm_owner }} group={{ kpm_group }} recurse=yes + ansible.builtin.file: + path: "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" + owner: "{{ kpm_owner }}" + group: "{{ kpm_group }}" + recurse: yes tags: kpm diff --git a/ansible/roles/migrations/tasks/flyway.yml b/ansible/roles/migrations/tasks/flyway.yml index 83617e75..83fff2a3 100644 --- a/ansible/roles/migrations/tasks/flyway.yml +++ b/ansible/roles/migrations/tasks/flyway.yml @@ -1,7 +1,10 @@ --- - name: Ensure Flyway install dir exists become: true - file: path={{ flyway_install_dir }} state=directory mode=u=rwx,g=rx,o=rx + ansible.builtin.file: + path: "{{ flyway_install_dir }}" + state: directory + mode: u=rwx,g=rx,o=rx tags: migrations # Note: we don't check the version but the binary is rarely updated @@ -37,5 +40,8 @@ - name: Set correct permissions become: true - file: path="{{ flyway_install_dir }}/killbill-flyway.jar" owner={{ flyway_owner }} group={{ flyway_group }} + ansible.builtin.file: + path: "{{ flyway_install_dir }}/killbill-flyway.jar" + owner: "{{ flyway_owner }}" + group: "{{ flyway_group }}" tags: migrations diff --git a/ansible/roles/tomcat/tasks/install.yml b/ansible/roles/tomcat/tasks/install.yml index b7f941dc..08fad0ed 100644 --- a/ansible/roles/tomcat/tasks/install.yml +++ b/ansible/roles/tomcat/tasks/install.yml @@ -55,12 +55,19 @@ # The individual files have the correct permissions already, but not the top directory - name: Set correct permissions become: true - file: path="{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" owner={{ tomcat_owner }} group={{ tomcat_group }} recurse=yes + ansible.builtin.file: + path: "{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" + owner: "{{ tomcat_owner }}" + group: "{{ tomcat_group }}" + recurse: yes tags: install - name: Symlink install directory become: true - file: src="{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" path="{{ catalina_home }}" state=link + ansible.builtin.file: + src: "{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" + path: "{{ catalina_home }}" + state: link tags: install - name: Set required Tomcat environment variables diff --git a/ansible/roles/tomcat/tasks/main.yml b/ansible/roles/tomcat/tasks/main.yml index 5f97e5d8..ee2c4285 100644 --- a/ansible/roles/tomcat/tasks/main.yml +++ b/ansible/roles/tomcat/tasks/main.yml @@ -1,7 +1,12 @@ --- - name: Ensure Tomcat dirs exist become: true - file: path={{ catalina_base }}/{{ item }} state=directory owner={{ tomcat_owner }} group={{ tomcat_group }} mode=u=rwx,g=rx,o=rx + ansible.builtin.file: + path: "{{ catalina_base }}/{{ item }}" + state: directory + owner: "{{ tomcat_owner }}" + group: "{{ tomcat_group }}" + mode: u=rwx,g=rx,o=rx with_items: - bin - conf diff --git a/docker/templates/killbill/latest/Dockerfile.template b/docker/templates/killbill/latest/Dockerfile.template index 7a4715de..9ca6205d 100644 --- a/docker/templates/killbill/latest/Dockerfile.template +++ b/docker/templates/killbill/latest/Dockerfile.template @@ -50,6 +50,7 @@ ENV KPM_DIAGNOSTIC_CMD="ansible-playbook $ANSIBLE_OPTS \ ENV MIGRATIONS_CMD="ansible-playbook $ANSIBLE_OPTS \ -e kpm_install_dir=$KPM_INSTALL_DIR \ + -e kpm_path=$KPM_INSTALL_DIR/kpm-latest \ -e kpm_yml=$KILLBILL_INSTALL_DIR/kpm.yml \ -e killbill_kpm_yml=$KILLBILL_INSTALL_DIR/kpm.yml \ -e kb_config_dir=$KILLBILL_INSTALL_DIR \ From 21639eab794a1eefe0e238ab73ee0f44180d903b Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 16:00:49 +0530 Subject: [PATCH 42/59] Fixed Ansible command error --- ansible/roles/kaui/tasks/json_logging.yml | 5 +---- ansible/roles/tomcat/tasks/install.yml | 11 ++--------- ansible/roles/tomcat/tasks/main.yml | 7 +------ 3 files changed, 4 insertions(+), 19 deletions(-) diff --git a/ansible/roles/kaui/tasks/json_logging.yml b/ansible/roles/kaui/tasks/json_logging.yml index 84cf3a2e..44e209f0 100644 --- a/ansible/roles/kaui/tasks/json_logging.yml +++ b/ansible/roles/kaui/tasks/json_logging.yml @@ -24,10 +24,7 @@ - name: Set correct permissions become: true - ansible.builtin.file: - path: "/opt/{{ item.name }}" - owner: "{{ tomcat_owner }}" - group: "{{ tomcat_group }}" + file: path=/opt/{{ item.name }} owner={{ tomcat_owner }} group={{ tomcat_group }} with_items: - name: jackson-databind.jar - name: jackson-core.jar diff --git a/ansible/roles/tomcat/tasks/install.yml b/ansible/roles/tomcat/tasks/install.yml index 08fad0ed..b7f941dc 100644 --- a/ansible/roles/tomcat/tasks/install.yml +++ b/ansible/roles/tomcat/tasks/install.yml @@ -55,19 +55,12 @@ # The individual files have the correct permissions already, but not the top directory - name: Set correct permissions become: true - ansible.builtin.file: - path: "{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" - owner: "{{ tomcat_owner }}" - group: "{{ tomcat_group }}" - recurse: yes + file: path="{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" owner={{ tomcat_owner }} group={{ tomcat_group }} recurse=yes tags: install - name: Symlink install directory become: true - ansible.builtin.file: - src: "{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" - path: "{{ catalina_home }}" - state: link + file: src="{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" path="{{ catalina_home }}" state=link tags: install - name: Set required Tomcat environment variables diff --git a/ansible/roles/tomcat/tasks/main.yml b/ansible/roles/tomcat/tasks/main.yml index ee2c4285..5f97e5d8 100644 --- a/ansible/roles/tomcat/tasks/main.yml +++ b/ansible/roles/tomcat/tasks/main.yml @@ -1,12 +1,7 @@ --- - name: Ensure Tomcat dirs exist become: true - ansible.builtin.file: - path: "{{ catalina_base }}/{{ item }}" - state: directory - owner: "{{ tomcat_owner }}" - group: "{{ tomcat_group }}" - mode: u=rwx,g=rx,o=rx + file: path={{ catalina_base }}/{{ item }} state=directory owner={{ tomcat_owner }} group={{ tomcat_group }} mode=u=rwx,g=rx,o=rx with_items: - bin - conf From 510487d123ec390e2b0d71561df601d9a2fa2ee8 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 16:08:28 +0530 Subject: [PATCH 43/59] Fixed Ansible command error --- .github/workflows/docker_ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker_ci.yml b/.github/workflows/docker_ci.yml index 04574c57..b56fbec3 100644 --- a/.github/workflows/docker_ci.yml +++ b/.github/workflows/docker_ci.yml @@ -8,8 +8,8 @@ on: env: # Doesn't matter too much, we just want to verify the build passes CURRENT_LTS: '0.24' - KB_VERSION: '0.24.16' - KAUI_VERSION: '4.0.6' + KB_VERSION: '0.24.15' + KAUI_VERSION: '3.0.20' jobs: docker_ci: From a5f62ea39e9b8e4540188a5a3a46b4f85829a00a Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 16:13:17 +0530 Subject: [PATCH 44/59] Fixed Ansible command error --- ansible/roles/killbill/tasks/main.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/ansible/roles/killbill/tasks/main.yml b/ansible/roles/killbill/tasks/main.yml index cf2d3eca..ac0ba42a 100644 --- a/ansible/roles/killbill/tasks/main.yml +++ b/ansible/roles/killbill/tasks/main.yml @@ -1,12 +1,7 @@ --- - name: Ensure Kill Bill dirs exist become: true - ansible.builtin.file: - path: "{{ item }}" - state: directory - owner: "{{ tomcat_owner }}" - group: "{{ tomcat_group }}" - mode: u=rwx,g=rx,o=rx + file: path={{ item }} state=directory owner={{ tomcat_owner }} group={{ tomcat_group }} mode=u=rwx,g=rx,o=rx with_items: - "{{ kb_config_dir }}" - "{{ kb_plugins_dir }}" @@ -79,11 +74,7 @@ - name: Set correct permissions become: true - ansible.builtin.file: - path: "{{ kb_install_dir }}" - owner: "{{ tomcat_owner }}" - group: "{{ tomcat_group }}" - recurse: yes + file: path={{ kb_install_dir }} owner={{ tomcat_owner }} group={{ tomcat_group }} recurse=yes tags: kpm-install - name: Create ROOT directory to unarchive the WAR From bc3a50df9f26879102a8b2ce4b883de256392adf Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 16:20:29 +0530 Subject: [PATCH 45/59] Fixed Ansible command error --- ansible/roles/kaui/tasks/main.yml | 13 ++----------- ansible/roles/kpm/tasks/main.yml | 11 ++--------- ansible/roles/migrations/tasks/flyway.yml | 10 ++-------- 3 files changed, 6 insertions(+), 28 deletions(-) diff --git a/ansible/roles/kaui/tasks/main.yml b/ansible/roles/kaui/tasks/main.yml index 2c167c5e..e8f49cc1 100644 --- a/ansible/roles/kaui/tasks/main.yml +++ b/ansible/roles/kaui/tasks/main.yml @@ -1,12 +1,7 @@ --- - name: Ensure Kaui dirs exist become: true - ansible.builtin.file: - path: "{{ item }}" - state: directory - owner: "{{ tomcat_owner }}" - group: "{{ tomcat_group }}" - mode: u=rwx,g=rx,o=rx + file: path={{ item }} state=directory owner={{ tomcat_owner }} group={{ tomcat_group }} mode=u=rwx,g=rx,o=rx with_items: - "{{ kaui_install_dir }}" - "{{ kaui_plugins_dir }}" @@ -64,11 +59,7 @@ - name: Set correct permissions become: true - ansible.builtin.file: - path: "{{ kaui_install_dir }}" - owner: "{{ tomcat_owner }}" - group: "{{ tomcat_group }}" - recurse: yes + file: path={{ kaui_install_dir }} owner={{ tomcat_owner }} group={{ tomcat_group }} recurse=yes tags: kpm-install - name: Create ROOT directory to unarchive the WAR diff --git a/ansible/roles/kpm/tasks/main.yml b/ansible/roles/kpm/tasks/main.yml index efd3f5dd..09bf690b 100644 --- a/ansible/roles/kpm/tasks/main.yml +++ b/ansible/roles/kpm/tasks/main.yml @@ -91,10 +91,7 @@ - name: Symlink install directory become: true - ansible.builtin.file: - src: "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" - path: "{{ kpm_path }}" - state: link + file: src="{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" path="{{ kpm_path }}" state=link tags: kpm # The first time KPM is run, a Gemfile.lock needs to written out @@ -109,9 +106,5 @@ # The individual files have the correct permissions already, but not the top directory - name: Set correct permissions become: true - ansible.builtin.file: - path: "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" - owner: "{{ kpm_owner }}" - group: "{{ kpm_group }}" - recurse: yes + file: path="{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" owner={{ kpm_owner }} group={{ kpm_group }} recurse=yes tags: kpm diff --git a/ansible/roles/migrations/tasks/flyway.yml b/ansible/roles/migrations/tasks/flyway.yml index 83fff2a3..83617e75 100644 --- a/ansible/roles/migrations/tasks/flyway.yml +++ b/ansible/roles/migrations/tasks/flyway.yml @@ -1,10 +1,7 @@ --- - name: Ensure Flyway install dir exists become: true - ansible.builtin.file: - path: "{{ flyway_install_dir }}" - state: directory - mode: u=rwx,g=rx,o=rx + file: path={{ flyway_install_dir }} state=directory mode=u=rwx,g=rx,o=rx tags: migrations # Note: we don't check the version but the binary is rarely updated @@ -40,8 +37,5 @@ - name: Set correct permissions become: true - ansible.builtin.file: - path: "{{ flyway_install_dir }}/killbill-flyway.jar" - owner: "{{ flyway_owner }}" - group: "{{ flyway_group }}" + file: path="{{ flyway_install_dir }}/killbill-flyway.jar" owner={{ flyway_owner }} group={{ flyway_group }} tags: migrations From 35e2b5b5f82355cc3373538c1db0bcb4a978cf03 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 16:25:38 +0530 Subject: [PATCH 46/59] Fixed Ansible command error --- ansible/roles/common/tasks/main.yml | 7 ++----- docker/templates/killbill/latest/Dockerfile.template | 1 - 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml index a134f58d..2f92b483 100644 --- a/ansible/roles/common/tasks/main.yml +++ b/ansible/roles/common/tasks/main.yml @@ -1,7 +1,4 @@ --- -- name: Setup Ansible ruby interpreter - ansible.builtin.set_fact: - ansible_ruby_interpreter: "{{ kpm_path }}/lib/ruby/bin/ruby" +- name: ansible_ruby_interpreter setup + set_fact: ansible_ruby_interpreter="{{ kpm_path }}/lib/ruby/bin/ruby" tags: common -# noqa: var-naming[no-role-prefix] -# Required for ansible-lint: variable must stay named 'ansible_ruby_interpreter' for Ansible to pick it up \ No newline at end of file diff --git a/docker/templates/killbill/latest/Dockerfile.template b/docker/templates/killbill/latest/Dockerfile.template index 9ca6205d..7a4715de 100644 --- a/docker/templates/killbill/latest/Dockerfile.template +++ b/docker/templates/killbill/latest/Dockerfile.template @@ -50,7 +50,6 @@ ENV KPM_DIAGNOSTIC_CMD="ansible-playbook $ANSIBLE_OPTS \ ENV MIGRATIONS_CMD="ansible-playbook $ANSIBLE_OPTS \ -e kpm_install_dir=$KPM_INSTALL_DIR \ - -e kpm_path=$KPM_INSTALL_DIR/kpm-latest \ -e kpm_yml=$KILLBILL_INSTALL_DIR/kpm.yml \ -e killbill_kpm_yml=$KILLBILL_INSTALL_DIR/kpm.yml \ -e kb_config_dir=$KILLBILL_INSTALL_DIR \ From 64f63935b82a126e28d0353696bb9e0b2a25eb41 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 16:51:39 +0530 Subject: [PATCH 47/59] Fixed Ansible command error --- .github/workflows/docker_ci.yml | 4 ++-- ansible/roles/kaui/tasks/json_logging.yml | 6 +++++- ansible/roles/tomcat/tasks/json_logging.yml | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker_ci.yml b/.github/workflows/docker_ci.yml index b56fbec3..04574c57 100644 --- a/.github/workflows/docker_ci.yml +++ b/.github/workflows/docker_ci.yml @@ -8,8 +8,8 @@ on: env: # Doesn't matter too much, we just want to verify the build passes CURRENT_LTS: '0.24' - KB_VERSION: '0.24.15' - KAUI_VERSION: '3.0.20' + KB_VERSION: '0.24.16' + KAUI_VERSION: '4.0.6' jobs: docker_ci: diff --git a/ansible/roles/kaui/tasks/json_logging.yml b/ansible/roles/kaui/tasks/json_logging.yml index 44e209f0..76d4a336 100644 --- a/ansible/roles/kaui/tasks/json_logging.yml +++ b/ansible/roles/kaui/tasks/json_logging.yml @@ -4,6 +4,7 @@ ansible.builtin.get_url: url: "{{ nexus_url }}/{{ nexus_repository }}/{{ item.group_path }}/{{ item.artifact_id }}/{{ item.version }}/{{ item.artifact_id }}-{{ item.version }}.jar" dest: "{{ item.dest }}" + mode: '0644' with_items: - group_path: com/fasterxml/jackson/core artifact_id: jackson-databind @@ -24,7 +25,10 @@ - name: Set correct permissions become: true - file: path=/opt/{{ item.name }} owner={{ tomcat_owner }} group={{ tomcat_group }} + ansible.builtin.file: + path: "/opt/{{ item.name }}" + owner: "{{ tomcat_owner }}" + group: "{{ tomcat_group }}" with_items: - name: jackson-databind.jar - name: jackson-core.jar diff --git a/ansible/roles/tomcat/tasks/json_logging.yml b/ansible/roles/tomcat/tasks/json_logging.yml index 4530a4d2..e5f70b22 100644 --- a/ansible/roles/tomcat/tasks/json_logging.yml +++ b/ansible/roles/tomcat/tasks/json_logging.yml @@ -4,6 +4,7 @@ ansible.builtin.get_url: url: "{{ nexus_url }}/{{ nexus_repository }}/net/logstash/logback/logstash-logback-encoder/6.4/logstash-logback-encoder-6.4.jar" dest: /opt/logstash-logback-encoder.jar + mode: '0644' tags: - killbill-logback - logstash From dc33c13d158a3f140e0beb85346464ef8339f340 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 16:58:29 +0530 Subject: [PATCH 48/59] Fixed Ansible command error --- ansible/roles/kaui/tasks/main.yml | 13 +++++++++++-- ansible/roles/killbill/tasks/main.yml | 13 +++++++++++-- ansible/roles/kpm/tasks/main.yml | 11 +++++++++-- ansible/roles/migrations/tasks/flyway.yml | 10 ++++++++-- ansible/roles/tomcat/tasks/install.yml | 11 +++++++++-- ansible/roles/tomcat/tasks/main.yml | 7 ++++++- 6 files changed, 54 insertions(+), 11 deletions(-) diff --git a/ansible/roles/kaui/tasks/main.yml b/ansible/roles/kaui/tasks/main.yml index e8f49cc1..2c167c5e 100644 --- a/ansible/roles/kaui/tasks/main.yml +++ b/ansible/roles/kaui/tasks/main.yml @@ -1,7 +1,12 @@ --- - name: Ensure Kaui dirs exist become: true - file: path={{ item }} state=directory owner={{ tomcat_owner }} group={{ tomcat_group }} mode=u=rwx,g=rx,o=rx + ansible.builtin.file: + path: "{{ item }}" + state: directory + owner: "{{ tomcat_owner }}" + group: "{{ tomcat_group }}" + mode: u=rwx,g=rx,o=rx with_items: - "{{ kaui_install_dir }}" - "{{ kaui_plugins_dir }}" @@ -59,7 +64,11 @@ - name: Set correct permissions become: true - file: path={{ kaui_install_dir }} owner={{ tomcat_owner }} group={{ tomcat_group }} recurse=yes + ansible.builtin.file: + path: "{{ kaui_install_dir }}" + owner: "{{ tomcat_owner }}" + group: "{{ tomcat_group }}" + recurse: yes tags: kpm-install - name: Create ROOT directory to unarchive the WAR diff --git a/ansible/roles/killbill/tasks/main.yml b/ansible/roles/killbill/tasks/main.yml index ac0ba42a..cf2d3eca 100644 --- a/ansible/roles/killbill/tasks/main.yml +++ b/ansible/roles/killbill/tasks/main.yml @@ -1,7 +1,12 @@ --- - name: Ensure Kill Bill dirs exist become: true - file: path={{ item }} state=directory owner={{ tomcat_owner }} group={{ tomcat_group }} mode=u=rwx,g=rx,o=rx + ansible.builtin.file: + path: "{{ item }}" + state: directory + owner: "{{ tomcat_owner }}" + group: "{{ tomcat_group }}" + mode: u=rwx,g=rx,o=rx with_items: - "{{ kb_config_dir }}" - "{{ kb_plugins_dir }}" @@ -74,7 +79,11 @@ - name: Set correct permissions become: true - file: path={{ kb_install_dir }} owner={{ tomcat_owner }} group={{ tomcat_group }} recurse=yes + ansible.builtin.file: + path: "{{ kb_install_dir }}" + owner: "{{ tomcat_owner }}" + group: "{{ tomcat_group }}" + recurse: yes tags: kpm-install - name: Create ROOT directory to unarchive the WAR diff --git a/ansible/roles/kpm/tasks/main.yml b/ansible/roles/kpm/tasks/main.yml index 09bf690b..efd3f5dd 100644 --- a/ansible/roles/kpm/tasks/main.yml +++ b/ansible/roles/kpm/tasks/main.yml @@ -91,7 +91,10 @@ - name: Symlink install directory become: true - file: src="{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" path="{{ kpm_path }}" state=link + ansible.builtin.file: + src: "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" + path: "{{ kpm_path }}" + state: link tags: kpm # The first time KPM is run, a Gemfile.lock needs to written out @@ -106,5 +109,9 @@ # The individual files have the correct permissions already, but not the top directory - name: Set correct permissions become: true - file: path="{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" owner={{ kpm_owner }} group={{ kpm_group }} recurse=yes + ansible.builtin.file: + path: "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" + owner: "{{ kpm_owner }}" + group: "{{ kpm_group }}" + recurse: yes tags: kpm diff --git a/ansible/roles/migrations/tasks/flyway.yml b/ansible/roles/migrations/tasks/flyway.yml index 83617e75..83fff2a3 100644 --- a/ansible/roles/migrations/tasks/flyway.yml +++ b/ansible/roles/migrations/tasks/flyway.yml @@ -1,7 +1,10 @@ --- - name: Ensure Flyway install dir exists become: true - file: path={{ flyway_install_dir }} state=directory mode=u=rwx,g=rx,o=rx + ansible.builtin.file: + path: "{{ flyway_install_dir }}" + state: directory + mode: u=rwx,g=rx,o=rx tags: migrations # Note: we don't check the version but the binary is rarely updated @@ -37,5 +40,8 @@ - name: Set correct permissions become: true - file: path="{{ flyway_install_dir }}/killbill-flyway.jar" owner={{ flyway_owner }} group={{ flyway_group }} + ansible.builtin.file: + path: "{{ flyway_install_dir }}/killbill-flyway.jar" + owner: "{{ flyway_owner }}" + group: "{{ flyway_group }}" tags: migrations diff --git a/ansible/roles/tomcat/tasks/install.yml b/ansible/roles/tomcat/tasks/install.yml index b7f941dc..08fad0ed 100644 --- a/ansible/roles/tomcat/tasks/install.yml +++ b/ansible/roles/tomcat/tasks/install.yml @@ -55,12 +55,19 @@ # The individual files have the correct permissions already, but not the top directory - name: Set correct permissions become: true - file: path="{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" owner={{ tomcat_owner }} group={{ tomcat_group }} recurse=yes + ansible.builtin.file: + path: "{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" + owner: "{{ tomcat_owner }}" + group: "{{ tomcat_group }}" + recurse: yes tags: install - name: Symlink install directory become: true - file: src="{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" path="{{ catalina_home }}" state=link + ansible.builtin.file: + src: "{{ tomcat_install_dir }}/apache-tomcat-{{ tomcat_version }}" + path: "{{ catalina_home }}" + state: link tags: install - name: Set required Tomcat environment variables diff --git a/ansible/roles/tomcat/tasks/main.yml b/ansible/roles/tomcat/tasks/main.yml index 5f97e5d8..ee2c4285 100644 --- a/ansible/roles/tomcat/tasks/main.yml +++ b/ansible/roles/tomcat/tasks/main.yml @@ -1,7 +1,12 @@ --- - name: Ensure Tomcat dirs exist become: true - file: path={{ catalina_base }}/{{ item }} state=directory owner={{ tomcat_owner }} group={{ tomcat_group }} mode=u=rwx,g=rx,o=rx + ansible.builtin.file: + path: "{{ catalina_base }}/{{ item }}" + state: directory + owner: "{{ tomcat_owner }}" + group: "{{ tomcat_group }}" + mode: u=rwx,g=rx,o=rx with_items: - bin - conf From a5362712692bfcbd704b9ed1df988fa8a2783c20 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 17:04:47 +0530 Subject: [PATCH 49/59] Fixed Ansible command error --- ansible/roles/tomcat/tasks/native.yml | 199 +++++++++++++++----------- 1 file changed, 112 insertions(+), 87 deletions(-) diff --git a/ansible/roles/tomcat/tasks/native.yml b/ansible/roles/tomcat/tasks/native.yml index 22f04a92..9ea5b122 100644 --- a/ansible/roles/tomcat/tasks/native.yml +++ b/ansible/roles/tomcat/tasks/native.yml @@ -1,108 +1,133 @@ --- -- name: set tomcat_native_libdir - set_fact: +- name: Set tomcat_native_libdir + ansible.builtin.set_fact: tomcat_native_libdir: "{{ catalina_home }}/native-jni-lib" when: tomcat_native_libdir is undefined tags: native -- name: check if native libaries are already built - stat: +- name: Check if native libaries are already built + ansible.builtin.stat: path: "{{ tomcat_native_libdir }}/libtcnative-1.so" - register: libtcnative + register: tomcat_libtcnative tags: native -- block: - - block: - - name: install toolchain - become: true - package: > - name={{ item }} - state=latest - with_items: - - dpkg-dev - - gcc - - libapr1-dev - - libssl-dev - - make - tags: native +- name: Build Tomcat native libraries + when: not tomcat_libtcnative.stat.exists + tags: native + block: - - name: find apr-1-config path - shell: which apr-1-config - register: apr_config_path_output + - name: Prepare build toolchain + when: tomcat_apr_config_path is undefined tags: native + block: + - name: Install toolchain + become: true + ansible.builtin.package: + name: "{{ item }}" + state: present + with_items: + - dpkg-dev + - gcc + - libapr1-dev + - libssl-dev + - make + tags: native - - name: set apr_config_path - set_fact: - apr_config_path: "{{ apr_config_path_output.stdout }}" - tags: native - when: apr_config_path is undefined - tags: native + - name: Find apr-1-config path + ansible.builtin.command: + argv: + - which + - apr-1-config + register: tomcat_apr_config_path_output + changed_when: false + tags: native - - block: - - name: find gnu_arch path - shell: dpkg-architecture --query DEB_BUILD_GNU_TYPE - register: gnu_arch_output - tags: native + - name: Set tomcat_apr_config_path + ansible.builtin.set_fact: + tomcat_apr_config_path: "{{ tomcat_apr_config_path_output.stdout }}" + tags: native - - name: set gnu_arch - set_fact: - gnu_arch: "{{ gnu_arch_output.stdout }}" + - name: Detect GNU architecture + when: tomcat_gnu_arch is undefined tags: native - when: gnu_arch is undefined - tags: native + block: + - name: Find tomcat_gnu_arch path + ansible.builtin.command: + argv: + - dpkg-architecture + - --query + - DEB_BUILD_GNU_TYPE + register: tomcat_gnu_arch_output + changed_when: false + tags: native + + - name: Set tomcat_gnu_arch + ansible.builtin.set_fact: + tomcat_gnu_arch: "{{ tomcat_gnu_arch_output.stdout }}" + tags: native - - name: create temporary build directory - tempfile: - state: directory - suffix: tomcat-native-build - register: workspace - tags: native + - name: Create temporary build directory + ansible.builtin.tempfile: + state: directory + suffix: tomcat-native-build + register: tomcat_workspace + tags: native - # become: true needed here as the user SSH'ing in might not be able to open /usr/share/tomcat/bin - - name: expand native libraries archive - become: true - unarchive: - src: "{{ catalina_home }}/bin/tomcat-native.tar.gz" - dest: "{{ workspace.path }}" - extra_opts: [--strip-components=1] - owner: "{{ ansible_user_id }}" - remote_src: yes - tags: native + # become: true needed here as the user SSH'ing in might not be able to open /usr/share/tomcat/bin + - name: Expand native libraries archive + become: true + ansible.builtin.unarchive: + src: "{{ catalina_home }}/bin/tomcat-native.tar.gz" + dest: "{{ tomcat_workspace.path }}" + extra_opts: [--strip-components=1] + owner: "{{ ansible_user_id }}" + remote_src: yes + tags: native - - name: configure native libraries - command: > - ./configure - --build="{{ gnu_arch }}" - --libdir="{{ tomcat_native_libdir }}" - --prefix="{{ catalina_home }}" - --with-apr="{{ apr_config_path }}" - --with-java-home="{{ java_home }}" - --with-ssl=yes - chdir="{{ workspace.path }}/native" - tags: native + - name: Configure native libraries + ansible.builtin.command: + argv: + - ./configure + - --build={{ tomcat_gnu_arch }} + - --libdir={{ tomcat_native_libdir }} + - --prefix={{ catalina_home }} + - --with-apr={{ tomcat_apr_config_path }} + - --with-java-home={{ java_home }} + - --with-ssl=yes + chdir: "{{ tomcat_workspace.path }}/native" + changed_when: false + tags: native - - name: build native libraries - command: > - make all - chdir="{{ workspace.path }}/native" - tags: native + - name: Build native libraries + ansible.builtin.command: + argv: + - make + - all + chdir: "{{ tomcat_workspace.path }}/native" + changed_when: false + tags: native - - name: install native libraries - become: true - command: > - make install - chdir="{{ workspace.path }}/native" - tags: native + - name: Install native libraries + become: true + ansible.builtin.command: + argv: + - make + - install + chdir: "{{ tomcat_workspace.path }}/native" + changed_when: false + tags: native - - name: set correct permissions - become: true - file: path={{ tomcat_native_libdir }} owner={{ tomcat_owner }} group={{ tomcat_group }} recurse=yes - tags: install + - name: Set correct permissions + become: true + ansible.builtin.file: + path: "{{ tomcat_native_libdir }}" + owner: "{{ tomcat_owner }}" + group: "{{ tomcat_group }}" + recurse: yes + tags: install - - name: remove temporary directory - file: - path="{{ workspace.path }}" - state=absent - tags: native - when: not libtcnative.stat.exists - tags: native + - name: Remove temporary directory + ansible.builtin.file: + path: "{{ tomcat_workspace.path }}" + state: absent + tags: native From 297bb53ac73f5ff587a0513dd16b51ee2a190a60 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 17:13:41 +0530 Subject: [PATCH 50/59] Fixed Ansible command error --- ansible/roles/kaui/tasks/main.yml | 6 +++--- ansible/roles/killbill/tasks/main.yml | 6 +++--- ansible/roles/migrations/tasks/flyway.yml | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ansible/roles/kaui/tasks/main.yml b/ansible/roles/kaui/tasks/main.yml index 2c167c5e..301a3495 100644 --- a/ansible/roles/kaui/tasks/main.yml +++ b/ansible/roles/kaui/tasks/main.yml @@ -45,7 +45,7 @@ - name: Check if a ROOT webapp is already installed ansible.builtin.stat: path: "{{ catalina_base }}/{{ kaui_webapps }}/ROOT" - register: existing_webapp + register: kaui_existing_webapp tags: tomcat # Only run kpm install if there is no exploded webapp already. Otherwise, @@ -58,8 +58,8 @@ become_user: "{{ tomcat_owner }}" killbill: kpm_path: "{{ kpm_path }}" - kpm_yml: "{{ kpm_yml }}" - when: not existing_webapp.stat.exists + kpm_yml: "{{ kaui_kpm_yml }}" + when: not kaui_existing_webapp.stat.exists tags: kpm-install - name: Set correct permissions diff --git a/ansible/roles/killbill/tasks/main.yml b/ansible/roles/killbill/tasks/main.yml index cf2d3eca..f9d56463 100644 --- a/ansible/roles/killbill/tasks/main.yml +++ b/ansible/roles/killbill/tasks/main.yml @@ -60,7 +60,7 @@ - name: Check if a ROOT webapp is already installed ansible.builtin.stat: path: "{{ catalina_base }}/{{ kb_webapps }}/ROOT" - register: existing_webapp + register: killbill_existing_webapp tags: tomcat # Only run kpm install if there is no exploded webapp already. Otherwise, @@ -73,8 +73,8 @@ become_user: "{{ tomcat_owner }}" killbill: kpm_path: "{{ kpm_path }}" - kpm_yml: "{{ kpm_yml }}" - when: not existing_webapp.stat.exists + kpm_yml: "{{ killbill_kpm_yml }}" + when: not killbill_existing_webapp.stat.exists tags: kpm-install - name: Set correct permissions diff --git a/ansible/roles/migrations/tasks/flyway.yml b/ansible/roles/migrations/tasks/flyway.yml index 83fff2a3..deced34b 100644 --- a/ansible/roles/migrations/tasks/flyway.yml +++ b/ansible/roles/migrations/tasks/flyway.yml @@ -18,15 +18,15 @@ ansible.builtin.uri: url: "{{ nexus_url }}/{{ nexus_repository }}/org/kill-bill/billing/killbill-util/maven-metadata.xml" return_content: yes - register: flyway_metadata - when: flyway_version is undefined + register: migrations_flyway_metadata + when: migrations_flyway_version is undefined tags: migrations # We don't use the xml module to avoid a dependency on lxml - - name: set flyway_version + - name: set migrations_flyway_version set_fact: - flyway_version: "{{ flyway_metadata.content | regex_search('(.*)', '\\1') | first }}" - when: flyway_version is undefined + migrations_flyway_version: "{{ migrations_flyway_metadata.content | regex_search('(.*)', '\\1') | first }}" + when: migrations_flyway_version is undefined tags: migrations - name: Install Flyway From 911a893657181aa236a2e38c073a12171e702b57 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 17:48:48 +0530 Subject: [PATCH 51/59] Fixed Ansible command error --- ansible/roles/common/tasks/main.yml | 2 +- ansible/roles/kpm/tasks/main.yml | 2 ++ ansible/roles/migrations/tasks/flyway.yml | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml index 2f92b483..00fa2c57 100644 --- a/ansible/roles/common/tasks/main.yml +++ b/ansible/roles/common/tasks/main.yml @@ -1,4 +1,4 @@ --- -- name: ansible_ruby_interpreter setup +- name: Ansible_ruby_interpreter setup set_fact: ansible_ruby_interpreter="{{ kpm_path }}/lib/ruby/bin/ruby" tags: common diff --git a/ansible/roles/kpm/tasks/main.yml b/ansible/roles/kpm/tasks/main.yml index efd3f5dd..0f8fa9fb 100644 --- a/ansible/roles/kpm/tasks/main.yml +++ b/ansible/roles/kpm/tasks/main.yml @@ -46,6 +46,7 @@ dest: "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-noarch.tar.gz" owner: "{{ kpm_owner }}" group: "{{ kpm_group }}" + mode: '0644' when: not kpm_bin.stat.exists and kpm_arch_test.status >= 400 tags: kpm @@ -75,6 +76,7 @@ dest: "{{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}.tar.gz" owner: "{{ kpm_owner }}" group: "{{ kpm_group }}" + mode: '0644' when: not kpm_bin.stat.exists and kpm_arch_test.status < 400 tags: kpm diff --git a/ansible/roles/migrations/tasks/flyway.yml b/ansible/roles/migrations/tasks/flyway.yml index deced34b..96025ab3 100644 --- a/ansible/roles/migrations/tasks/flyway.yml +++ b/ansible/roles/migrations/tasks/flyway.yml @@ -23,8 +23,8 @@ tags: migrations # We don't use the xml module to avoid a dependency on lxml - - name: set migrations_flyway_version - set_fact: + - name: Set migrations_flyway_version + ansible.builtin.set_fact: migrations_flyway_version: "{{ migrations_flyway_metadata.content | regex_search('(.*)', '\\1') | first }}" when: migrations_flyway_version is undefined tags: migrations @@ -35,6 +35,7 @@ ansible.builtin.get_url: url: "{{ nexus_url }}/{{ nexus_repository }}/org/kill-bill/billing/killbill-util/{{ migrations_flyway_version }}/killbill-util-{{ migrations_flyway_version }}-flyway.jar" dest: "{{ flyway_install_dir }}/killbill-flyway.jar" + mode: '0644' tags: migrations From db9ab7a6fd9b85a5a47dccfaae5467c70ce5048f Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 18:22:54 +0530 Subject: [PATCH 52/59] Fixed Ansible command error --- ansible/roles/common/tasks/main.yml | 4 +++- ansible/roles/migrations/tasks/flyway.yml | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml index 00fa2c57..f17457f1 100644 --- a/ansible/roles/common/tasks/main.yml +++ b/ansible/roles/common/tasks/main.yml @@ -1,4 +1,6 @@ --- -- name: Ansible_ruby_interpreter setup +- name: Setup Ansible ruby interpreter set_fact: ansible_ruby_interpreter="{{ kpm_path }}/lib/ruby/bin/ruby" tags: common +# noqa: var-naming[no-role-prefix] +# Required for ansible-lint: variable must stay named 'ansible_ruby_interpreter' for Ansible to pick it up \ No newline at end of file diff --git a/ansible/roles/migrations/tasks/flyway.yml b/ansible/roles/migrations/tasks/flyway.yml index 96025ab3..f48e1882 100644 --- a/ansible/roles/migrations/tasks/flyway.yml +++ b/ansible/roles/migrations/tasks/flyway.yml @@ -13,6 +13,10 @@ path: "{{ flyway_install_dir }}/killbill-flyway.jar" register: flyway_bin tags: migrations + +- name: Install Flyway if not present + when: not flyway_bin.stat.exists + tags: migrations block: - name: Download killbill-flyway release metadata ansible.builtin.uri: From cbb5072f685a0e08ebe5047df5dcc18b957f1784 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 18:46:59 +0530 Subject: [PATCH 53/59] Fixed Ansible command error --- ansible/roles/common/tasks/main.yml | 3 ++- ansible/roles/kpm/tasks/main.yml | 1 + ansible/roles/migrations/tasks/flyway.yml | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml index f17457f1..a134f58d 100644 --- a/ansible/roles/common/tasks/main.yml +++ b/ansible/roles/common/tasks/main.yml @@ -1,6 +1,7 @@ --- - name: Setup Ansible ruby interpreter - set_fact: ansible_ruby_interpreter="{{ kpm_path }}/lib/ruby/bin/ruby" + ansible.builtin.set_fact: + ansible_ruby_interpreter: "{{ kpm_path }}/lib/ruby/bin/ruby" tags: common # noqa: var-naming[no-role-prefix] # Required for ansible-lint: variable must stay named 'ansible_ruby_interpreter' for Ansible to pick it up \ No newline at end of file diff --git a/ansible/roles/kpm/tasks/main.yml b/ansible/roles/kpm/tasks/main.yml index 0f8fa9fb..23117d8f 100644 --- a/ansible/roles/kpm/tasks/main.yml +++ b/ansible/roles/kpm/tasks/main.yml @@ -66,6 +66,7 @@ become: true command: "mv {{ kpm_install_dir }}/kpm-{{ kpm_version }}-noarch {{ kpm_install_dir }}/kpm-{{ kpm_version }}-linux-{{ ansible_architecture }}" when: not kpm_bin.stat.exists and kpm_arch_test.status >= 400 + changed_when: false tags: kpm - name: Download pre-built KPM diff --git a/ansible/roles/migrations/tasks/flyway.yml b/ansible/roles/migrations/tasks/flyway.yml index f48e1882..91600875 100644 --- a/ansible/roles/migrations/tasks/flyway.yml +++ b/ansible/roles/migrations/tasks/flyway.yml @@ -11,11 +11,11 @@ - name: Check if Flyway is already installed ansible.builtin.stat: path: "{{ flyway_install_dir }}/killbill-flyway.jar" - register: flyway_bin + register: migrations_flyway_bin tags: migrations - name: Install Flyway if not present - when: not flyway_bin.stat.exists + when: not migrations_flyway_bin.stat.exists tags: migrations block: - name: Download killbill-flyway release metadata From 43e308801d3a124cf5c51985fdf368737e5633e8 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 18:51:22 +0530 Subject: [PATCH 54/59] Fixed Ansible command error --- ansible/roles/common/tasks/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml index a134f58d..f17457f1 100644 --- a/ansible/roles/common/tasks/main.yml +++ b/ansible/roles/common/tasks/main.yml @@ -1,7 +1,6 @@ --- - name: Setup Ansible ruby interpreter - ansible.builtin.set_fact: - ansible_ruby_interpreter: "{{ kpm_path }}/lib/ruby/bin/ruby" + set_fact: ansible_ruby_interpreter="{{ kpm_path }}/lib/ruby/bin/ruby" tags: common # noqa: var-naming[no-role-prefix] # Required for ansible-lint: variable must stay named 'ansible_ruby_interpreter' for Ansible to pick it up \ No newline at end of file From a9330fd6d4d22c8c8f98a3651773eeb268160879 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 18:57:32 +0530 Subject: [PATCH 55/59] Fixed Ansible command error --- ansible/roles/common/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml index f17457f1..29f02ae7 100644 --- a/ansible/roles/common/tasks/main.yml +++ b/ansible/roles/common/tasks/main.yml @@ -2,5 +2,5 @@ - name: Setup Ansible ruby interpreter set_fact: ansible_ruby_interpreter="{{ kpm_path }}/lib/ruby/bin/ruby" tags: common -# noqa: var-naming[no-role-prefix] +# noqa: no-free-form,var-naming[no-role-prefix] # Required for ansible-lint: variable must stay named 'ansible_ruby_interpreter' for Ansible to pick it up \ No newline at end of file From 555fa65dd04f80387ef1832a858d35372f25532a Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 19:54:53 +0530 Subject: [PATCH 56/59] Fixed Ansible command error --- ansible/roles/common/tasks/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml index 29f02ae7..c4a81fbd 100644 --- a/ansible/roles/common/tasks/main.yml +++ b/ansible/roles/common/tasks/main.yml @@ -1,6 +1,5 @@ --- -- name: Setup Ansible ruby interpreter +- name: Setup Ansible ruby interpreter # noqa: no-free-form,var-naming[no-role-prefix] set_fact: ansible_ruby_interpreter="{{ kpm_path }}/lib/ruby/bin/ruby" tags: common -# noqa: no-free-form,var-naming[no-role-prefix] # Required for ansible-lint: variable must stay named 'ansible_ruby_interpreter' for Ansible to pick it up \ No newline at end of file From 3bf918306cd9aceaf8c6e70fec8b47c9d8793afc Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 19:57:22 +0530 Subject: [PATCH 57/59] Fixed Ansible command error --- ansible/roles/common/tasks/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml index c4a81fbd..171cdebc 100644 --- a/ansible/roles/common/tasks/main.yml +++ b/ansible/roles/common/tasks/main.yml @@ -1,5 +1,6 @@ --- -- name: Setup Ansible ruby interpreter # noqa: no-free-form,var-naming[no-role-prefix] +- name: Setup Ansible ruby interpreter set_fact: ansible_ruby_interpreter="{{ kpm_path }}/lib/ruby/bin/ruby" tags: common -# Required for ansible-lint: variable must stay named 'ansible_ruby_interpreter' for Ansible to pick it up \ No newline at end of file + # noqa: no-free-form,var-naming[no-role-prefix] + # Required for ansible-lint: variable must stay named 'ansible_ruby_interpreter' for Ansible to pick it up \ No newline at end of file From e7715d6a42b567ca731fdb2a2ed052bb023bc315 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 20:00:51 +0530 Subject: [PATCH 58/59] Fixed Ansible command error --- ansible/roles/common/tasks/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml index 171cdebc..b1733977 100644 --- a/ansible/roles/common/tasks/main.yml +++ b/ansible/roles/common/tasks/main.yml @@ -1,6 +1,5 @@ --- - name: Setup Ansible ruby interpreter - set_fact: ansible_ruby_interpreter="{{ kpm_path }}/lib/ruby/bin/ruby" + set_fact: ansible_ruby_interpreter="{{ kpm_path }}/lib/ruby/bin/ruby" # noqa: no-free-form,var-naming[no-role-prefix] tags: common - # noqa: no-free-form,var-naming[no-role-prefix] # Required for ansible-lint: variable must stay named 'ansible_ruby_interpreter' for Ansible to pick it up \ No newline at end of file From 9a8e156223b037c69d5ed4714f3d720e6c83ed9a Mon Sep 17 00:00:00 2001 From: Vijay N Date: Fri, 30 Jan 2026 20:06:25 +0530 Subject: [PATCH 59/59] Fixed Ansible command error --- .github/workflows/ansible_lint.yml | 2 +- ansible/roles/common/tasks/main.yml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ansible_lint.yml b/.github/workflows/ansible_lint.yml index cd239af0..7d910151 100644 --- a/.github/workflows/ansible_lint.yml +++ b/.github/workflows/ansible_lint.yml @@ -14,6 +14,6 @@ jobs: uses: ansible/ansible-lint@v25.9.2 with: working_directory: ansible/ - args: "-x role-name,fqcn[action-core],role-name[path],yaml[line-length]" + args: "-x no-free-form,role-name,fqcn[action-core],role-name[path],yaml[line-length]" env: ANSIBLE_LIBRARY: ${{ github.workspace }}/ansible/library diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml index b1733977..359ed309 100644 --- a/ansible/roles/common/tasks/main.yml +++ b/ansible/roles/common/tasks/main.yml @@ -1,5 +1,6 @@ --- - name: Setup Ansible ruby interpreter - set_fact: ansible_ruby_interpreter="{{ kpm_path }}/lib/ruby/bin/ruby" # noqa: no-free-form,var-naming[no-role-prefix] + set_fact: ansible_ruby_interpreter="{{ kpm_path }}/lib/ruby/bin/ruby" tags: common + # noqa: var-naming[no-role-prefix] # Required for ansible-lint: variable must stay named 'ansible_ruby_interpreter' for Ansible to pick it up \ No newline at end of file