fuel-library/deployment/puppet/cobbler/templates/snippets/ubuntu_repos_late.erb
Igor Kalnitsky 8ea8bc301c Remove repo settings if Ubuntu installer gets done
We have to keep system clear after installation, because otherwise we
may have some bad post effect. You see, the Nailgun itself sends task
for adding repos to the slaves so there could be some conflicts if
by some reason we had use different set of repos for provisioning and
deployment.

Change-Id: I43ee90bbeee096244ad4dd6c2e32b7663ae56904
Implements: blueprint consume-external-ubuntu
2015-04-02 12:57:44 +03:00

19 lines
797 B
Plaintext

#import json
## We assume ks_meta contains repo_setup variable
## Cleaning up sources.list
echo > /target/etc/apt/sources.list; \
mkdir -p /target/etc/apt/sources.list.d; \
mkdir -p /target/etc/apt/preferences.d; \
#set $repo_setup = json.loads($getVar("repo_setup"))
#set $repos = $repo_setup["repos"]
#for $repo in $repos
echo 'deb $repo["uri"] $repo["suite"] $repo["section"]' > /target/etc/apt/sources.list.d/${repo["name"]}.list; \
#if not $repo.get("priority")
#continue
#end if
echo 'Package: *' > /target/etc/apt/preferences.d/$repo["name"]; \
echo 'Pin: release a=$repo["suite"]' >> /target/etc/apt/preferences.d/$repo["name"]; \
echo 'Pin-Priority: $repo["priority"]' >> /target/etc/apt/preferences.d/$repo["name"]; \
echo '' >> /target/etc/apt/preferences.d/$repo["name"]; \
#end for