{"id":13715550,"url":"https://github.com/cidrblock/td4a","last_synced_at":"2025-04-05T16:06:28.737Z","repository":{"id":27035162,"uuid":"112228107","full_name":"cidrblock/td4a","owner":"cidrblock","description":"Template designer for automation","archived":false,"fork":false,"pushed_at":"2023-12-19T11:25:20.000Z","size":3285,"stargazers_count":213,"open_issues_count":5,"forks_count":35,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-29T15:04:31.260Z","etag":null,"topics":["ansible","automation","jinja2","jinja2-templates","network"],"latest_commit_sha":null,"homepage":null,"language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cidrblock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-11-27T17:42:33.000Z","updated_at":"2025-03-22T08:26:41.000Z","dependencies_parsed_at":"2023-01-14T05:51:28.948Z","dependency_job_id":"1b5a2ca6-4d56-449d-985b-83efb87b2b93","html_url":"https://github.com/cidrblock/td4a","commit_stats":{"total_commits":48,"total_committers":4,"mean_commits":12.0,"dds":0.08333333333333337,"last_synced_commit":"54f99283772220fab9e7191b32f89c589a6db127"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cidrblock%2Ftd4a","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cidrblock%2Ftd4a/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cidrblock%2Ftd4a/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cidrblock%2Ftd4a/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cidrblock","download_url":"https://codeload.github.com/cidrblock/td4a/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247361686,"owners_count":20926643,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","automation","jinja2","jinja2-templates","network"],"created_at":"2024-08-03T00:01:00.413Z","updated_at":"2025-04-05T16:06:28.710Z","avatar_url":"https://github.com/cidrblock.png","language":"CSS","funding_links":[],"categories":["Tools","network"],"sub_categories":[],"readme":"![screenshot](screenshot.png)\n## Template Designer for Automation\n\n### Try it now\n\nhttps://td4a.codethenetwork.com\n\n### Overview\n\nTD4A is a visual design aid for building and testing jinja2 templates.  It will combine data in yaml format with a jinja2 template and render the output.\n\nAll jinja2 filters are supported along with the filter plugins from Ansible version 2.9.12\n\n### Installation:\n\n##### using podman (or docker):\n```\npodman pull cidrblock/td4a\n```\n\nThe container registry page can be found here:\n\nhttps://hub.docker.com/r/cidrblock/td4a/\n\n#### using the cli:\n```\n$ virtualenv venv\n$ source venv/bin/activate\n$ pip install td4a\n```\n\nThe pip package can be found here:\n\nhttps://pypi.python.org/pypi/td4a\n\n### Starting the TD4A server\n\n\n#### Simple\n\n##### using podman (or docker):\n```\npodman run -p 5000:5000 cidrblock/td4a\n```\n\n##### using the cli:\n```\ntd4a-server\n```\n\n##### open your browser to:\n\nhttp://127.0.0.1:5000\n\n### Modes\n\nTD4A support two different modes of operation.\n- Templating: Build and render jinja2 templates\n- Schema: Build and validate a json schema for your data\n\n#### Enabling a mode\n\n##### using podman (or docker):\n```\npodman run  -p 5000:5000 \\\n            -it \\\n            cidrblock/td4a \\\n            td4a-server -m mode\n```\n\n##### using the cli:\n```\ntd4a-server -m mode\n```\n\nwhere `mode` is either jinja2 (default) or schema\n\n### Additional configuration options\n\n#### Loading custom filter plugins (jinja2 mode only)\n\n\nTD4A supports custom filter plugins within the container. Pass your custom filter_plugins directory as a volume and use the -f option to specify to custom filter plugin directory.\n\n##### using podman (or docker):\n```\npodman run  -p 5000:5000 \\\n            -it \\\n            -v `pwd`/my_filter_plugins:/filter_plugins \\\n            cidrblock/td4a \\\n            td4a-server -f /filter_plugins\n```\n\n##### using the cli:\n\nTD4A can load custom filters from a directory specified from the command line:\n```\ntd4a-server -f ./my_filter_plugins\n```\n\n#### Loading an ansible inventory (jinja2 and schema mode)\n\nMount the inventory as `/inventory` in the container, and run TD4A with the `-i` option.\n\n\n##### using podman (or docker):\n\n```\npodman run  -p 5000:5000 \\\n            -it \\\n            -v '/Users/me/github/ansible_network_inventory:/inventory' \\\n            cidrblock/td4a \\\n            td4a-server -i /inventory -m mode -v 'my_vault_password'\n```\n\nIf environment variables are needed for a dynamic inventory, they can be passed to the docker container.\n```\npodman run  -p 5000:5000 \\\n            -it \\\n            -v `pwd`/my_filter_plugins:/filter_plugins \\\n            -v '/Users/me/github/ansible_network_inventory:/inventory' \\\n            -e \"COUCH_USERNAME=admin\" \\\n            -e \"COUCH_PASSWORD=password\" \\\n            -e \"COUCH_URL=http://192.168.1.5:5984/td4a\" \\\n            -e \"DYNAMIC_INVENTORY_USERNAME=api\" \\\n            -e \"DYNAMIC_INVENTORY_PASSWORD=password\" \\\n            cidrblock/td4a \\\n            td4a-server -f /filter_plugins -m mode -i /inventory -v 'my_vault_password'\n```            \n\n##### using the cli:\n\nTD4A can load multiple ansible inventories, specifc each with `-i` on the command line:\n```\ntd4a-server -i ./my_ansible_inventory -v 'my_vault_password'\n```\n\n#### Enabling storage and links using a couch database (jinja2 and schema mode)\n\nTD4A has the ability to store data and templates in a CouchDB.  This is disabled by default.\n\nThe CouchDB needs to previously created.\n\nTo enable link support, and add the link button to the UI, set the following environ variables:\n\n##### using podman (or docker):\n\n```\npodman run  -p 5000:5000 \\\n            -v `pwd`/my_filter_plugins:/filter_plugins \\\n            -e \"COUCH_USERNAME=admin\" \\\n            -e \"COUCH_PASSWORD=password\" \\\n            -e \"COUCH_URL=http://192.168.1.5:5984/td4a\" \\\n            cidrblock/td4a \\\n            td4a-server -m mode\n```\n\n##### using the cli:\n```\nexport COUCH_USERNAME=admin\nexport COUCH_PASSWORD=password\nexport COUCH_URL=http://localhost:5984/td4a\ntd4a-server -m mode\n```\n\n### User Interface\n\nThe interface is browser based and has been tested using Chrome. If your browser did not automatically open when TD4A was started, you can visit http://127.0.0.1:5000 to see the interface.\n\nThe UI is broken into three sections:\n\n1) DATA, this is where the data in yaml format is provided.\n2) TEMPLATE, the jinja2 template to be rendered.\n3) RESULT, after clicking the render button, the result pane will be populated with the rendered template.\n\n#### Keyboard shortcuts\n\n`cmd+r`: Render the template\n\n`cmd+s`: Save the data in browser local storage\n\n`cmd+b`: Begin new, clear the screen\n\n### Python version\n\nTo date, this has only been tested with python 3.8.5.\n\n### Development\n\nNPM and related packages are required to build the UI.\n\n```\nnpm install\n```\n\nThe UI components can be installed for development purposes using bower.\n\n```\nbower install\n```\n\nThe dependancies can be concatenated and minified using gulp.\n\n```\ngulp\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcidrblock%2Ftd4a","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcidrblock%2Ftd4a","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcidrblock%2Ftd4a/lists"}