forked from docs/doc-exports
Reviewed-by: Goncharov, Artem <artem.goncharov@t-systems.com> Co-authored-by: gtema <artem.goncharov@gmail.com> Co-committed-by: gtema <artem.goncharov@gmail.com>
52 lines
1.6 KiB
YAML
52 lines
1.6 KiB
YAML
- name: Emit pandoc version
|
|
command: "pandoc --version"
|
|
|
|
# Since role is applied in the loop it is necessary to unset host facts
|
|
- name: Reset convert_params
|
|
ansible.builtin.set_fact:
|
|
convert_params: ""
|
|
|
|
- name: Add destination to parameters
|
|
ansible.builtin.set_fact:
|
|
convert_params: "{{ convert_params }} --dest {{ dest }}"
|
|
when:
|
|
- "dest is defined"
|
|
- "dest | length > 0"
|
|
|
|
- name: Add title to parameters
|
|
ansible.builtin.set_fact:
|
|
convert_params: "{{ convert_params }} --title '{{ doc_title }}'"
|
|
when:
|
|
- "doc_title is defined"
|
|
- "doc_title | length > 0"
|
|
|
|
- name: Add service to parameters
|
|
ansible.builtin.set_fact:
|
|
convert_params: "{{ convert_params }} --service '{{ doc_service }}'"
|
|
when:
|
|
- "doc_service is defined"
|
|
- "doc_service | length > 0"
|
|
|
|
- name: Add repo_name to parameters
|
|
ansible.builtin.set_fact:
|
|
convert_params: "{{ convert_params }} --repo-name '{{ doc_repo_name }}'"
|
|
when:
|
|
- "doc_repo_name is defined"
|
|
- "doc_repo_name | length > 0"
|
|
|
|
- name: Add pdf_name to parameters
|
|
ansible.builtin.set_fact:
|
|
convert_params: "{{ convert_params }} --pdf-name {{ doc_pdf_name }}"
|
|
when:
|
|
- "doc_pdf_name is defined"
|
|
- "doc_pdf_name | length > 0"
|
|
|
|
- name: Add templates-location to parameters
|
|
ansible.builtin.set_fact:
|
|
convert_params: "{{ convert_params }} --templates-location {{ zuul_work_dir }}/templates"
|
|
|
|
- name: Convert {{ doc_label | default('') }} HTML to RST
|
|
args:
|
|
executable: "/bin/bash"
|
|
ansible.builtin.shell: "source {{ zuul_work_virtualenv }}/bin/activate; otc-convert-doc {{ convert_params }} {{ source }}"
|