Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

Repository::apt::Maintain - manage /etc/apt/sources.list #416

Open
keyurkapasi opened this issue Dec 16, 2013 · 9 comments
Open

Repository::apt::Maintain - manage /etc/apt/sources.list #416

keyurkapasi opened this issue Dec 16, 2013 · 9 comments

Comments

@keyurkapasi
Copy link

Using the sketch for sources.list file, how we can provide params for multiple lines as it doesn't work even if we give separate params configuration for all the repository entry. We have to use sources.list.d/file1... file2..file3... for each repository urls.

I am newbie for sketches but have worked in cfengine 3.4.1.

Could you please help me to us /etc/apt/sources.list having multiple repositories in the same file using Repository::apt::Maintain sketches. ?

@tzz
Copy link
Contributor

tzz commented Dec 18, 2013

Hi @keyurkapasi

Could you post an example of the desired end result, whether it's one file or multiple sources.lists? I can try to prepare a set of JSON parameters that do what you need and show the intended usage. Thanks!

@keyurkapasi
Copy link
Author

We have our own repository as mentioned below which I need in the file /etc/apt/sources.list file.

deb http://url_of_repo/debian-security squeeze/updates main contrib non-free
deb-src http://url_of_repo/debian-security squeeze/updates main contrib non-free
deb http://url_of_repo/debian squeeze-updates main contrib non-free
deb-src http://url_of_repo/debian squeeze-updates main contrib non-free
deb http://url_of_repo/debian squeeze main contrib non-free
deb-src http://url_of_repo/debian squeeze main contrib non-free
deb http://url_of_repo/debian-backports squeeze-backports main contrib non-free
deb-src http://url_of_repo/debian-backports squeeze-backports main contrib non-free
deb http://url_of_repo/brodos squeeze_i386/
deb http://url_of_repo/brodos squeeze_amd64/

Could you please help me configured the same.

@tzz
Copy link
Contributor

tzz commented Dec 26, 2013

Thanks! Everyone is on vacation this week and next but we'll try to give you a solution as soon as we're back.

@keyurkapasi
Copy link
Author

Hi,

Any luck on the same ?

@tzz
Copy link
Contributor

tzz commented Jan 23, 2014

Sorry, we're all ridiculously busy working on the CFEngine 3.6.0 release.

If you want to maintain the main sources.list, here's an example to cover the first 4 lines of your list:

[
    {
        "Repository::apt::Maintain":
        {
            url: "http://url_of_repo/debian-security",
            distribution: "squeeze/updates",
            components: [ "main", "contrib", "non-free" ],
            types: ["deb", "deb-src"],
        },
    },
    {
        "Repository::apt::Maintain":
        {
            url: "http://url_of_repo/debian",
            distribution: "squeeze-updates",
            components: [ "main", "contrib", "non-free" ],
            types: ["deb", "deb-src"],
        },
    },
]

Add wipe: true to the first one if you want only your lines to exist, but that will make the file get rewritten every time (wipe for first line, then add every line, saving the file each time). With wipe:true you're better off using separate files for each repo, which you can do by adding the file: /a/b/c parameter. Note also that by having separate activations you can control which machines get which activations (by specifying the activated context at the DC level).

In a future version we'll try to support wipe:true better for the main sources list by passing all the repo parameters as one big list instead of separate activations.

@keyurkapasi
Copy link
Author

Thanks for your response !!

Well we have few more repositories (4-5) hence the code would be bigger using each. Wanted some solution which can help me to generate only one file having all repositories in /etc/apt/sources.list instead of using sources.list.d/files...

Check if you could find something like that whenever your convenience... :)

@nickanderson
Copy link
Member

I believe this could be done result with tags and variables matching hotness in 3.6.

I want to do it, but bandwidth.

@keyurkapasi
Copy link
Author

Any luck on the solution ?

tzz pushed a commit to tzz/design-center that referenced this issue Jun 1, 2014
@rehan-dev
Copy link

how to add 4 to 9 repository urls in one custom github repository with custom name?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

4 participants