use directory files/, not templates
Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
This commit is contained in:
		
					parent
					
						
							
								e52a059adf
							
						
					
				
			
			
				commit
				
					
						aa3e92f07b
					
				
			
		
					 1 changed files with 3 additions and 3 deletions
				
			
		|  | @ -164,8 +164,8 @@ For more details consult sudoers(5) | ||||||
| 
 | 
 | ||||||
| TEMPLATING | TEMPLATING | ||||||
| ---------- | ---------- | ||||||
| * create directory templates/ in your type (convention) | * create directory files/ in your type (convention) | ||||||
| * create the template as an executable file like templates/basic.conf.sh, it will output text using shell variables for the values | * create the template as an executable file like files/basic.conf.sh, it will output text using shell variables for the values | ||||||
| 
 | 
 | ||||||
| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||||||
| #!/bin/sh | #!/bin/sh | ||||||
|  | @ -191,7 +191,7 @@ EOF | ||||||
|   export ROOT='/var/www/test' |   export ROOT='/var/www/test' | ||||||
| # render the template | # render the template | ||||||
|   mkdir -p "$__object/files" |   mkdir -p "$__object/files" | ||||||
|   "$__type/templates/basic.conf.sh" > "$__object/files/basic.conf" |   "$__type/files/basic.conf.sh" > "$__object/files/basic.conf" | ||||||
| # send the rendered template | # send the rendered template | ||||||
|   __file /etc/nginx/sites-available/test.conf  \ |   __file /etc/nginx/sites-available/test.conf  \ | ||||||
|     --state present |     --state present | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue