Questions tagged [template]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
47 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
85 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
84 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
342 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
6k 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
191 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
120 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
692 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
255 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: ...