Questions tagged [template]

69 questions
13
votes
8 answers

How to find which template is used for a site or a page in SharePoint

How/where can I find the template used for a SharePoint site or page. I have a page I want to resemble, but I don't know where to find the template for that page and site?
noesgard
  • 293
  • 1
  • 5
  • 16
12
votes
4 answers

Referring to an existing resource in CF Template

We have multiple CloudFormation scripts to create our stack. Now, we want to write (automate) new scripts which will be used just to updated 1 specific resource (business requirement). The thing which i am stuck at is how to refer to an existing…
Em Ae
  • 221
  • 1
  • 2
  • 3
9
votes
1 answer

salt stack: use state jinja variables in template

What I'd like to do is generate multiple configuration files for each openvpn user. I have the IP address and additional configuration in pillar. For example: openvpn: - user1: ip: 1.2.3.4 config: - line1 - line2 In the SLS…
Herrberg
  • 93
  • 1
  • 1
  • 3
7
votes
2 answers

How to call a puppet filetemplate twice with different parameters without using define?

i try to create two different files with one template, because they only diff by one line. file { "/tmp/bootstrap-raid.sh": content => template("pxe/bootstrap.sh.erb"), } file { "/tmp/bootstrap-noraid.sh": content =>…
c33s
  • 1,465
  • 3
  • 20
  • 39
5
votes
4 answers

How to trigger a custom error from inside a Jinja template?

Though Ansible itself has a way for triggering a custom error, I can not find anything similar for Jinja. My current method uses a syntax error: {% if 'ansible_mounts' in hostvars[host] %} # {{ host }} knows its mount-points {% else %} # {% error!!…
Mikhail T.
  • 2,272
  • 1
  • 22
  • 49
4
votes
1 answer

How to do multiline Jinja2 conditionals in single block?

The below code is rejected as syntactically incorrect: {% if inventory_hostname in groups.aptcache set cachehost = 'localhost' else set cachehost = groups['aptcache'] | first endif %} cache={{ cachehost }} I hope, my…
Mikhail T.
  • 2,272
  • 1
  • 22
  • 49
4
votes
1 answer

Chef - multiple files dynamic template resource

I'm trying to find a way to apply template resource dynamically on all files which are in a folder inside the cookbook's template folder. something like: Dir.foreach("../templates/default/shared/") do | file | # This is the wrong line... template…
SecondThought
  • 409
  • 1
  • 4
  • 11
4
votes
2 answers

Get filename for puppet template

I have a file that I'd like to reuse for a few different purposes. The file is 90% the same across uses, just slight differences. I'd rather not replicate the content across multiple files in puppet, so is there a way to do something like file {…
Noodles
  • 1,356
  • 3
  • 18
  • 29
4
votes
1 answer

How to connect instances in CloudFormation

We would like to create a template for a fairly standard stack in AWS. We need three layers. Layer: Elastic Load Balancer Layer: several web servers which are created / destroyed according to alarms triggered by the demand on the site Layer: a…
3
votes
2 answers

Format for hdr_sub pattern matching

I am trying to match the value of a header which has a space in it and cannot figure out what regex expressions haproxy likes. The header I'm after looks like this: X-Request-ID:'Foo: Bar' I would be Ok to match exactly this header or anything that…
Yana K.
  • 131
  • 1
  • 2
3
votes
3 answers

placeholder for later username in /etc/skel

Is there any possibility to use a placeholder in the config files located in /etc/skel that is replaced by the username later? e.g. I place ":USER:" in one config file and create a new user with the username "test". Then ":USER:" should be replaced…
lug
  • 33
  • 3
3
votes
2 answers

Using Including Class Name in Conditionals with Puppet Templates

I'm in a situation where, for ease of management reasons, I would like to use the same config file template for two classes. I only expect a small section of the config file to be different between the two, and since I expect both classes to be…
Scott Pack
  • 14,717
  • 10
  • 51
  • 83
2
votes
1 answer

sys-unconfig equivalent for Fedora 30

I'm trying to prepare a Fedora 30 KVM virtual machine template on Proxmox. I wanted to use the sys-unconfig command but it was removed in initscripts 9.81-1 virt-sysprep failed when I ran it from Proxmox host. What is the alternative for Fedora 30?
jwalker
  • 98
  • 7
2
votes
1 answer

Building a properties file with Ansible where the Property should not be added if the value doesn't exist

I am trying to build a property file with mandatory and optional properties in Ansible with templating. I want each essentially-static string (each optional property name) to show up only if the associated property value exists (from an Ansible…
Ryan
  • 65
  • 2
  • 7
2
votes
1 answer

Deleting Xenserver Virtual Machine used for Template

I created a custom Windows VM in Xenserver 6.5. I took a snapshot and used the snapshot to create a template that can be used for future reference. Is it possible to delete the VM I used to create the template or will that impact my ability to use…
jrd1989
  • 628
  • 10
  • 35
1
2 3 4 5