What's the deal with Deno? We talk with a major contributor to find out. Listen now.

Questions tagged [template]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
29 views

Simple and standard way to generate files based on templates?

For my projects I need a way to generate some files based on template ones. I envision it this way: a template file contains data with something like {{var1}} in place of the variables to be replaced ...
1
vote
0answers
26 views

Create VM from template , Hostname issue

I created a VM from RHEL ISO Fle, and followed some steps to cleanup nic details and also inserted a systemd script to create machine id. Converted VM to template, However when i spin a new VM with ...
0
votes
1answer
34 views

ansible playbook with jinja2 loop

I need to write a playbook using jinja2 tamplate inorder to write firewalld rule in ansible. For that I wrote --- - name: Firewalld check hosts: localhost become: yes tasks: - name: Allow ...
2
votes
0answers
24 views

Is there a way to have code templates for “if”, “for” (or) for any multiline commands in terminal?

Code templates are handy and help in finishing codes without error. I am aware that notepad editors like atom provide code templates for if and for loop for bash. Also aware that man pages provide ...
1
vote
1answer
33 views

Ansible - template from dictionary item

Ansible - template from dictionary item 1'st: Trying to write task which creates files from template NODES: node1: server: host1 script: manage1 node2: server: host2 script: ...
0
votes
0answers
62 views

Applying Job Template to subgroups in an inventory on Ansible-AWX

I have installed Ansible-AWX 8.0.0 version by using https://github.com/andyjsharp/ansible-junos-awx. I created an inventory with groups and nested groups. As of now, Job templates are called only on ...
0
votes
1answer
73 views

Uploading sudoers.d file through ansible gives syntax error but opening and saving in vi fixes it

Alright, I know the question title sucks, but it's the same with the situation itself. What I am trying to do is this: Create a file with sudoers configuration locally Use Ansible to ubload that ...
0
votes
1answer
235 views

What is wrong in this shell script?

It can not generate two temp-files! Why not? Please help!! The input-file has two columns for the file names. But it fails to copy the TWO-files "fn1", "fn2" into "Data1.dat", "Data2.dat" What is ...
0
votes
1answer
380 views

Tool for creating and calling folder structure templates?

Is there a Linux utility for creating templates for directory structures, outside of the scripts packaged with a DE like Gnome or LXDE? (I run openbox and would like to avoid a DE at all costs) There ...
2
votes
0answers
156 views

Rename a template when creating it

I added the "Empty file" (empty text document) to the Templates folder. Is possible to rename it automatically when I create it? As when using new folder. My file manager is nautilus.
2
votes
1answer
88 views

A utility to append content into a file, if this content isn't already in the file (even in part)

Is there a *Nix utility by which I could append content to a file (say, append the content of a template file into the end of a second file), only if the content isn't already available in the second ...
0
votes
1answer
595 views

CentOS 6 how to clear machine ID for a template? [duplicate]

I want to create a template from CentOS 6 so that each VM feels like a unique install. I found sys-unconfig which works but I don't like that it asks for a new password on boot. What alternatives are ...
0
votes
1answer
12k views

for loop in jinja2 [closed]

Please explain to me how can I fix this problem? i have this file defaults/main.yml --- node1: ip: 1.1.1.1 node2: ip: 2.2.2.2 node3: ip: 3.3.3.3 Now, I want in template file ip.j2 by for loop ...
0
votes
1answer
514 views

separator value from fact variable in ansible

I get ssh connection from fact variable in fact. my code in template (get-ip.j2): nod= {{ ansible_env.SSH_CONNECTION }} my output is : nod= 192.168.231.115 55414 192.168.231.91 22 Now, how can ...
0
votes
3answers
154 views

GNU sed - Creating a modified version of an existing template, based on an variable argument

This question is about rendering templates with sed. I have the template file nginx_app: server { root ${drt}/${domain}/; server_name ${domain} www.${domain}; } I use that file in another ...
0
votes
1answer
1k views

How to replace variable strings in a file? [duplicate]

I have a file with variables in it like below, however I want to use this file as a template and replace the variables with its actual value. Is there a way to read the file contents and evaluate the ...
5
votes
4answers
369 views

Is there an easy way to do the equivalent of `sed …` replacing the same line with multiple values?

I have a file where I want to replace some variables with data from a shell script. -A INPUT -i lo -s @LOCAL_IP@ -j ACCEPT Here I want to replace @LOCAL_IP@ with an IP address, I use the following: ...