design-center icon indicating copy to clipboard operation
design-center copied to clipboard

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

Open keyurkapasi opened this issue 12 years ago • 9 comments

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. ?

keyurkapasi avatar Dec 16 '13 09:12 keyurkapasi

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!

tzz avatar Dec 18 '13 22:12 tzz

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.

keyurkapasi avatar Dec 25 '13 14:12 keyurkapasi

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

tzz avatar Dec 26 '13 00:12 tzz

Hi,

Any luck on the same ?

keyurkapasi avatar Jan 17 '14 12:01 keyurkapasi

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.

tzz avatar Jan 23 '14 14:01 tzz

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... :)

keyurkapasi avatar Jan 24 '14 05:01 keyurkapasi

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

I want to do it, but bandwidth.

nickanderson avatar Jan 24 '14 05:01 nickanderson

Any luck on the solution ?

keyurkapasi avatar Mar 19 '14 13:03 keyurkapasi

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

rehan-dev avatar Jul 24 '14 00:07 rehan-dev