diff --git a/roles/odoo/README.md b/roles/odoo/README.md index f177538d..7bc35c6a 100644 --- a/roles/odoo/README.md +++ b/roles/odoo/README.md @@ -7,7 +7,7 @@ Deploy Odoo Docker container. Configure the role. ```yml -# https://hub.docker.com/_/odoo/ +# https://hub.docker.com/r/mintsystem/odoo/ odoo_revision: "16.0.20240603" odoo_image: mintsystem/odoo:16.0.20240603 odoo_build_image: true # default: false @@ -114,6 +114,7 @@ Once workers are active the longpolling port moves from 8069 to 8072 and therefo Configure these vars when using the official Odoo image: ```yml +# https://hub.docker.com/_/odoo/ odoo_revision: "16.0.20240603" odoo_image: odoo@sha256:df0276cdb0ff8bb7883058071daf898d90fdbf13045ae96d131584660878da84 odoo_conf: | # default: "" diff --git a/roles/odoo_repos/README.md b/roles/odoo_repos/README.md index e9cf9729..d64ba5a0 100644 --- a/roles/odoo_repos/README.md +++ b/roles/odoo_repos/README.md @@ -10,6 +10,7 @@ Configure the role. odoo_data_dir: /usr/share/odoo # default: "/usr/share/{{ odoo_hostname }}" odoo_revision: "16.0.20240603" odoo_repo_key_file: /home/bot/.ssh/id_ed25519 +github_personal_access_token: # default: "{{ vault_github_personal_access_token }}" odoo_repos: - path: enterprise url: git@github.com:odoo/enterprise.git @@ -39,6 +40,18 @@ The following tags are available: ## Docs +### Clone with http url + + +To clone private repos with an http url set the `vault_github_personal_access_token` var and define `github_username`. Use the following format to clone repos with http: + +```yml +odoo_repos: + - path: enterprise + url: https://{{ github_username }}:{{ github_personal_access_token }}@github.com/odoo/enterprise.git + version: 8638ccc9cc26b997caee852e266b7ecc6f7c632a +``` + ### Pull repo manually Navigate into the repo directory on the server `cd /usr/share/odoo01/enterprise` and run: diff --git a/roles/odoo_repos/defaults/main.yml b/roles/odoo_repos/defaults/main.yml index f5107dd9..1676b51e 100644 --- a/roles/odoo_repos/defaults/main.yml +++ b/roles/odoo_repos/defaults/main.yml @@ -1,2 +1,3 @@ --- odoo_data_dir: /usr/share/{{ odoo_hostname }} +github_personal_access_token: "{{ vault_github_personal_access_token }}" diff --git a/roles/odoo_repos/tasks/odoo_repos.yml b/roles/odoo_repos/tasks/odoo_repos.yml index cee9c305..cd773bf8 100644 --- a/roles/odoo_repos/tasks/odoo_repos.yml +++ b/roles/odoo_repos/tasks/odoo_repos.yml @@ -7,7 +7,7 @@ ansible.builtin.debug: msg: "Odoo version: {{ odoo_version }}" -- name: Pull repo branch +- name: Pull repo branch with ssh ansible.builtin.git: repo: "{{ item.url }}" dest: "{{ odoo_data_dir }}/{{ item.path }}" @@ -16,10 +16,10 @@ single_branch: "{{ item.single_branch | default(true) }}" accept_hostkey: true force: true - when: item.url is regex('git@') + when: item.url is regex('git@') and odoo_repo_key_file is defined loop: "{{ odoo_repos }}" -- name: Checkout repo commit +- name: Checkout repo commit with ssh ansible.builtin.git: repo: "{{ item.url }}" dest: "{{ odoo_data_dir }}/{{ item.path }}" @@ -28,7 +28,30 @@ refspec: +refs/heads/{{ odoo_version }}:refs/remotes/origin/{{ odoo_version }} accept_hostkey: true force: true - when: item.url is regex('git@') + when: item.url is regex('git@') and odoo_repo_key_file is defined + loop: "{{ odoo_repos }}" + notify: Restart odoo container + +- name: Pull repo branch with http + ansible.builtin.git: + repo: "{{ item.url }}" + dest: "{{ odoo_data_dir }}/{{ item.path }}" + version: "{{ odoo_version }}" + single_branch: "{{ item.single_branch | default(true) }}" + accept_hostkey: true + force: true + when: item.url is regex('https://') and github_username is defined + loop: "{{ odoo_repos }}" + +- name: Checkout repo commit with http + ansible.builtin.git: + repo: "{{ item.url }}" + dest: "{{ odoo_data_dir }}/{{ item.path }}" + version: "{{ item.version }}" + refspec: +refs/heads/{{ odoo_version }}:refs/remotes/origin/{{ odoo_version }} + accept_hostkey: true + force: true + when: item.url is regex('https://') and github_username is defined loop: "{{ odoo_repos }}" notify: Restart odoo container diff --git a/roles/pushgateway/defaults/main.yml b/roles/pushgateway/defaults/main.yml index 230c9610..86e40d6f 100644 --- a/roles/pushgateway/defaults/main.yml +++ b/roles/pushgateway/defaults/main.yml @@ -12,6 +12,5 @@ pushgateway_hostname: pushgateway01 pushgateway_args: - --web.listen-address={{ pushgateway_port }} #- --web.external-url= - - --web.route-prefix="/pushgateway" + - --web.route-prefix="/pushgateway" - --persistence.file=/pushgateway/state -