tinet icon indicating copy to clipboard operation
tinet copied to clipboard

RFC: templates feature

Open slankdev opened this issue 3 years ago • 2 comments

After tinet up. this feature creates files on docker containers with html/template.

---
nodes:
- name: hoge
  image: hoge
  vars:
    bgp_on: "yes"
    out: "test text"
  templates:
  - dst: /etc/frr/daemons
    src: daemons.j2
  - dst: /etc/out.txt
    content: |
      test "{{ .out }}"
...

slankdev avatar Aug 22 '20 06:08 slankdev

https://golang.org/pkg/text/template/

slankdev avatar Aug 22 '20 06:08 slankdev

I hate myself to enable with this syntax... X(

postinit:
  cmds:
  - cmd: |
      cat <<EOF >/tmp/out1.txt
      line1
      line2
      EOF
  - cmd: docker cp /tmp/out1.txt R1:/out1.txt

slankdev avatar Aug 22 '20 06:08 slankdev