Skip to content

Commit

Permalink
Revert "ztp provisioning script as a template"
Browse files Browse the repository at this point in the history
This reverts commit eb95178.
  • Loading branch information
iljarotar committed Dec 12, 2024
1 parent 3ace65e commit f65afe1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
21 changes: 10 additions & 11 deletions partition/roles/ztp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,13 @@ The result of this is unpredictable and, in the worst case, the switch might rea

## Variables

| Name | Mandatory | Description |
| ----------------------- | --------- | ---------------------------------------------------------------------------------------------- |
| ztp_nginx_image_name | yes | the docker image to use to serve ztp scripts. |
| ztp_nginx_image_tag | yes | the tag of the docker image to use to serve ztp scripts. |
| ztp_host_dir_path | | the path to serve ztp scripts from. |
| ztp_listen_address | | the address used to serve ztp requests |
| ztp_port | | the port to serve ztp scripts on. |
| ztp_authorized_keys | yes | the authorized keys that should be installed by ztp. |
| ztp_admin_user | | the user for which the authorized keys will be provisioned. |
| ztp_additional_files | | puts additional files into serve directory. |
| ztp_provisioning_script | | jinja template for optional ztp-provisioning-script.sh to be executed at the end of `ztp.json` |
| Name | Mandatory | Description |
| -------------------- | --------- | ----------------------------------------------------------- |
| ztp_nginx_image_name | yes | the docker image to use to serve ztp scripts. |
| ztp_nginx_image_tag | yes | the tag of the docker image to use to serve ztp scripts. |
| ztp_host_dir_path | | the path to serve ztp scripts from. |
| ztp_listen_address | | the address used to serve ztp requests |
| ztp_port | | the port to serve ztp scripts on. |
| ztp_authorized_keys | yes | the authorized keys that should be installed by ztp. |
| ztp_admin_user | | the user for which the authorized keys will be provisioned. |
| ztp_additional_files | | puts additional files into serve directory. |
7 changes: 0 additions & 7 deletions partition/roles/ztp/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@
- ztp.json.j2
- ztp.sh.j2

- name: render ztp-provisioning-script
template:
content: "{{ ztp_provisioning_script }}"
dest: "{{ ztp_host_dir_path }}/config/ztp-provisioning-script.sh"
mode: 0644
when: ztp_provisioning_script is defined

- name: copy frr.conf
copy:
dest: "{{ ztp_host_dir_path }}/config/frr.conf"
Expand Down
2 changes: 1 addition & 1 deletion partition/roles/ztp/templates/ztp.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"clear-config": true
},
{% if ztp_provisioning_script %}
{% if ztp_additional_files | selectattr('name', 'equalto', 'ztp-provisioning-script.sh') %}
"05-provisioning-script": {
"plugin": {
"url": "http://{{ ztp_listen_address }}:{{ ztp_port }}/ztp-provisioning-script.sh"
Expand Down

0 comments on commit f65afe1

Please sign in to comment.