Notes on Dynamic Tags

From Scire Wiki

Jump to: navigation, search

If people had to make a script for every package they wanted to install or update then Scire would be prohibitivly painstaking. So naturally this leads to dynamic tags, which will allow parts of a script (or config file) to be replaced on deployment.
An example form for tags is to use %%tagname%% since %% is rarely found in scripts.
So an example script might look like:

#!/bin/bash
emerge %%package%%
echo "%%IP%% %%HOSTNAME%%" > /etc/hosts

Users will be able to define the lowercase tags on the add_job page. The uppercase tags will be filled in by database values from client/hardware/software tables.
A potential way to implement this in the backend is with a table to store the tag/value pair.

DROP TABLE IF EXISTS dyn_tags;
  jobid INT NOT NULL,
  tag VARCHAR(30) NOT NULL,
  tag_value VARCHAR(255),
  PRIMARY KEY (jobid, tag),
  FOREIGN KEY (jobid) REFERENCES jobs.jobid
) ENGINE = MyISAM;
Personal tools