AutoPkgr Can't Assign Policies/Groups to a Specific Site

McAwesome
Valued Contributor

I've been toying around with AutoPkgr lately to see if it would be a good fit. What I'm working on now is overrides to make it fit our needs. One of our needs is the ability to assign policies and groups to an existing site. Our organization is potentially large enough that we'll end up with multiple sites each with their own testing set up and builds, so to keep things nicely organized it'd be best to auto-assign things to the appropriate site. AutoPkgr works fine if no site is specified, but fails immediately if it's assigning to a pre-existing group that has a site or if you attempt to specify a site in an override file.

Does anyone know of a way to add sites into the override files that works?

1 ACCEPTED SOLUTION

McAwesome
Valued Contributor

Of course soon after I make a post on it I figure out exactly what I need to do.

Future reference, you need to add the following into the RecipeOverride folder's PolicyTemplate.xml and SmartGroupTemplate.xml

<site>
     <id>id-of-site</id>
     <name>name-of-site</name>
</site>

I guess you could also add it into the main versions of the two templates if you really don't want to mess with overrides.

View solution in original post

2 REPLIES 2

McAwesome
Valued Contributor

Of course soon after I make a post on it I figure out exactly what I need to do.

Future reference, you need to add the following into the RecipeOverride folder's PolicyTemplate.xml and SmartGroupTemplate.xml

<site>
     <id>id-of-site</id>
     <name>name-of-site</name>
</site>

I guess you could also add it into the main versions of the two templates if you really don't want to mess with overrides.

elliotjordan
Contributor III

Hi @McAwesome, thanks for posting the solution!

I'd recommend against editing the main SmartGroupTemplate.xml and PolicyTemplate.xml files. Modifying those files will cause trouble when you do autopkg repo-update later. Use overrides instead.