<div dir="ltr"><div><div><div><div><div><div><div><div>Hi, I'm trying to automatize the creation and updating of pulp repos with puppet/scripting but i've found a problem.<br><br></div>I need to execute series of commands to determine if the repo exists or not yet . i.e:<br>

<br></div><span style="font-family:courier new,monospace">pulp-admin repo list | grep $repo-id</span><br><br></div>... but, how can I know, for example, if the feed its correct or i need to update it. Somethin like this may be ok:<br>

</div><br></div><span style="font-family:courier new,monospace">pulp-admin repo search --str-eq='feed=<a href="http://foo/bar">http://foo/bar</a>' | grep $repo-id</span><br><br></div>if the exit is 0 the feed is correct, if the exit is 1 i need to launch <span style="font-family:courier new,monospace">pulp-admin rpm repo update....</span><br>

<br></div><div>But this command not exists.<br></div><div><br></div>Maybe the correct way to obtain this is trought the API but for a in-home creation of a puppet custom definition is easiest this way.<br><br></div><div>
Any advice?<br>
</div><div><br></div>Thanks and apologize for my english.<br></div>