Git Product home page Git Product logo

aptly's Introduction

aptly Cookbook

Cookbook Version Build Status OpenCollective OpenCollective License

This cookbook installs and configures aptly http://www.aptly.info

Maintainers

This cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of Chef cookbook maintainers working together to maintain important cookbooks. If youโ€™d like to know more please visit sous-chefs.org or come chat with us on the Chef Community Slack in #sous-chefs.

Requirements

Platform

  • Debian 9
  • Debian 10
  • Ubuntu 16.04
  • Ubuntu 18.04

Attributes

Repository attributes

  • default['aptly']['repository']['uri'] = 'http://repo.aptly.info/'
  • default['aptly']['repository']['dist'] = 'squeeze'
  • default['aptly']['repository']['components'] = 'main'
  • default['aptly']['repository']['key'] = 'https://www.aptly.info/pubkey.txt'

Global repository attributes

  • default['aptly']['user'] = 'aptly'
  • default['aptly']['group'] = 'aptly'
  • default['aptly']['tmpDir'] = '/tmp'
  • default['aptly']['rootDir'] = '/opt/aptly'
  • default['aptly']['downloadConcurrency'] = 4
  • default['aptly']['downloadSpeedLimit'] = 0
  • default['aptly']['architectures'] = []
  • default['aptly']['dependencyFollowSuggests'] = false
  • default['aptly']['dependencyFollowRecommends'] = false
  • default['aptly']['dependencyFollowAllVariants'] = false
  • default['aptly']['dependencyFollowSource'] = false
  • default['aptly']['gpgDisableSign'] = false
  • default['aptly']['gpgDisableVerify'] = false
  • default['aptly']['gpgProvider'] = 'gpg'
  • default['aptly']['downloadSourcePackages'] = false
  • default['aptly']['skipLegacyPool'] = true
  • default['aptly']['ppaDistributorID'] = 'ubuntu'
  • default['aptly']['ppaCodename'] = ''
  • default['aptly']['FileSystemPublishEndpoints'] = {}
  • default['aptly']['S3PublishEndpoints'] = {}
  • default['aptly']['SwiftPublishEndpoints'] = {}

GPG attributes

  • default['aptly']['gpg']['key-type'] = 'RSA'
  • default['aptly']['gpg']['key-length'] = 4096
  • default['aptly']['gpg']['subkey-type'] = 'RSA'
  • default['aptly']['gpg']['subkey-length'] = 4096
  • default['aptly']['gpg']['name-real'] = 'Aptly'
  • default['aptly']['gpg']['name-comment'] = 'Aptly Key'
  • default['aptly']['gpg']['name-email'] = '[email protected]'
  • default['aptly']['gpg']['expire-date'] = 0
  • default['aptly']['gpg']['passphrase'] = 'GreatPassPhrase'

Recipes

default

Install and configure aptly

Resources

Testing

Please contribute to keep unit and functional tests up to date. After modifications, please run the following commands to check if you break something:

  • chef exec rspec
  • kitchen test default-ubuntu-1804

NOTE: if you want to use Policyfile, rename Policyfile.rb.dist to Policyfile.rb in root and test directories, then execute chef update in each folder. Look inside .kitchen.yml and spec/spec_helper.rb too.

Contributors

This project exists thanks to all the people who contribute.

Backers

Thank you to all our backers!

https://opencollective.com/sous-chefs#backers

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website.

https://opencollective.com/sous-chefs/sponsor/0/website https://opencollective.com/sous-chefs/sponsor/1/website https://opencollective.com/sous-chefs/sponsor/2/website https://opencollective.com/sous-chefs/sponsor/3/website https://opencollective.com/sous-chefs/sponsor/4/website https://opencollective.com/sous-chefs/sponsor/5/website https://opencollective.com/sous-chefs/sponsor/6/website https://opencollective.com/sous-chefs/sponsor/7/website https://opencollective.com/sous-chefs/sponsor/8/website https://opencollective.com/sous-chefs/sponsor/9/website

aptly's People

Contributors

agoddard avatar axelrtgs avatar bcandrea avatar bitfehler avatar damacus avatar eheydrick avatar frank-m avatar freakinhippie avatar fuuzetsu avatar jjustice6 avatar johnroesler avatar josephholsten avatar kitchen-porter avatar mmartyn avatar mynamewastaken avatar nilskuehme avatar powerschill avatar raboo avatar ramereth avatar renovate[bot] avatar sbadia avatar serjs avatar tas50 avatar xorima avatar xorimabot avatar ypno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aptly's Issues

Unable to see the changes done by cookbook in server

I'm able to execute the aptly commands(aptly repo create) successfully using the cookbook but when i login to actual server and execute 'aptly repo list' it's showing no repositories.

Can some one figure out what's the issue?

Thanks in advance

Remove .rubocop.yml with Dangerfile

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

๐Ÿ‘ป Brief Description

If the only thing in the .rubocop/yml is Dangerfile
Run the latest cookstyle
Remove .rubpopo.yml

Issue sprouted from sous-chefs/meta/issues/108. If not applicable then issue should be closed.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • sous-chefs/.github 3.1.1
  • actions/checkout v4
  • actionshub/chef-install 3.0.0
  • actionshub/test-kitchen 3.0.0
.github/workflows/stale.yml
  • actions/stale v9

  • Check this box to trigger a request for Renovate to run again on this repository

Problematic attribute renaming and a missing directory

We pulled in the 1.0 release of this cookbook to our environment and suddenly saw our aptly root directory disappear from its expected location. It turns out renaming the Chef attribute rootdir to rootDir resulted in the default recipe changing the aptly user's home from our rootdir value to the cookbook default rootDir value, which the Chef user resource then interprets as a request to move the old home to the new home. Until we figured that out, though, it certainly looked like this release destroyed the entire repository.

I understand this is a major release with no assurances of backwards compatibility, but this ultimately minor change has enormous and undeclared consequences. In my experience, renaming attributes needs a really good reason - I don't see one provided here - and either transitional bits to assist the change or a big warning to users to not get tripped up on the shift.

There is a typo in the node['aptly']['gpg']['key-tpye'] attribute

๐Ÿ‘ป Brief Description

There is a typo in the node['aptly']['gpg']['key-tpye'] attribute. Presumably, it should be node['aptly']['gpg']['key-type'].

๐Ÿฅž Cookbook version

aptly cookbook v2.1.2

๐Ÿ‘ฉโ€๐Ÿณ Chef-Infra Version

Chef client v15.13.8

๐ŸŽฉ Platform details

Ubuntu 18.04 LTS (bionic)

Steps To Reproduce

N/A

๐Ÿš“ Expected behavior

The attribute should be node['aptly']['gpg']['key-type'].

โž• Additional context

I'll submit a PR shortly.

Update builds to be parallel

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

๐Ÿ‘ป Brief Description

As part of our build process we should build each possible operating system separately

  1. Ensure you have dokken setup and working:
  2. dokken: aliased to KITCHEN_LOCAL_YAML=kitchen.dokken.yml kitchen
  3. run dokken list, you should see a list of builds with dokken as the provider
  4. download: https://github.com/sous-chefs/repo-management/blob/master/scripts/circleci_maker.rb and make this executable
  5. run: dokken list -j | ./circleci_maker.rb > .circleci/config.yml

Issue sprouted from sous-chefs/meta/issues/112. If not applicable then issue should be closed.

Allow switching snapshots

:person_frowning: Problem Statement

aptly publish switch is not exposed as part of the functionality. This means we can't switch to new snapshots automatically.

โ” Possible Solution

#20

โคด๏ธ Describe alternatives you've considered

Manually use execute which sucks.

The mirror resource does not have properties for all flags available to aptly mirror create, particularly architectures

Cookbook version

current

Chef-client version

any

Platform Details

Any

Scenario:

Mirror specific architectures per specific mirrors

Steps to Reproduce:

Look at https://github.com/sous-chefs/aptly/blob/master/resources/mirror.rb#L19-L29 and see there is no architecture property.

Expected Result:

I was expecting to be able to define specific architectures for specific mirrors as not all the mirrors I was hoping to mirror have the same architectures available. For instance, http://mirrors.rit.edu/ubuntu/dists/bionic/ only has amd64 and i386, while http://repo.percona.com/apt/dists/bionic/main/ supports amd64, i386, i686, and x86_64. and http://ppa.launchpad.net/canonical-support/support-tools/ubuntu/dists/xenial/main/ supports tons of architectures.

Actual Result:

You are stuck only setting a single set of architectures on a global level in https://github.com/sous-chefs/aptly/blob/master/attributes/default.rb#L30 , which requires you to resort to shelling out to configure any mirrors with different sets of architectures.

Aptly supports mirror-specific architectures according to https://www.aptly.info/doc/aptly/mirror/create/ .

Note that several of the other options are also missing as properties.

Expose the --gpg-key option to aptly publish

:person_frowning: Problem Statement

Currently when using this recipe, the first thing it does is generate a GPG key to use when publishing snapshots. We're not allowed to pass in our own key and subsequent aptly publish actions only assume the presence of the one, generated key.

Nevertheless, it's possible to use ones own key by replacing .gnupg directory with one containing pre-generated key.

This is however quite annoying to do: it'd be much easier if we could instead import existing keys into the .gnupg via standard means and then have the recipe use the correct one.

Replacing the whole .gnupg is especially annoying if we decide that we want to change the GPG mid-way through: just importing a new key would be much easier.

โ” Possible Solution

I think this can potentially be addressed by the --gpg-key flag of aptly publish. If there publish resource had an option to specify key by ID, the user can import their own keys and use those instead.

โคด๏ธ Describe alternatives you've considered

Replacing .gnupg completely after the cookbook creates it.

Run latest cookstyle

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

๐Ÿ‘ป Brief Description

Chef have released updated cookstyle rules, we should therefore run the auto fix against the cookbook

  1. Ensure you are on the latest stable chef-workstation
  2. Run cookstyle -a

Issue sprouted from sous-chefs/meta/issues/111. If not applicable then issue should be closed.

aptly_mirror resource does not update filter if changed after creation

๐Ÿ‘ป Brief Description

When using the aptly_mirror resource with a filter condition, the filter does not get updated if it is changed after the mirror has been created.

๐Ÿฅž Cookbook version

aptly cookbook v2.1.2

๐Ÿ‘ฉโ€๐Ÿณ Chef-Infra Version

Chef client v15.13.8

๐ŸŽฉ Platform details

Ubuntu 18.04 LTS (bionic)

Steps To Reproduce

recipes/mirrors.rb:

aptly_mirror 'hashicorp-bionic-main' do
  architectures ['amd64']
  component 'main'
  distribution 'bionic'
  filter 'consul (>= 1.8.1)'
  filter_with_deps true
  keyid 'E8A032E094D8EB4EA189D270DA418C88A3219F7B'
  keyserver 'pool.sks-keyservers.net'
  uri 'https://apt.releases.hashicorp.com'
  action [:create, :update]
end

Converge the node:

~$ aptly mirror show hashicorp-bionic-main
Name: hashicorp-bionic-main
Archive Root URL: https://apt.releases.hashicorp.com/
Distribution: bionic
Components: main
Architectures: amd64
Download Sources: no
Download .udebs: no
Filter: consul (>= 1.8.1)
Filter With Deps: yes
Last update: 2020-08-14 16:09:06 UTC
Number of packages: 3

Information from release file:
Acquire-By-Hash: yes
Architectures: amd64 i386
Codename: bionic
Components: main
Date: Thu, 13 Aug 2020 16:37:20 UTC
Label: Artifactory
Origin: Artifactory
Suite: bionic

Then update the filter expression, and reconverge:

aptly_mirror 'hashicorp-bionic-main' do
  architectures ['amd64']
  component 'main'
  distribution 'bionic'
  filter 'consul (>= 1.8.1) | vault (>= 1.5)'
  filter_with_deps true
  keyid 'E8A032E094D8EB4EA189D270DA418C88A3219F7B'
  keyserver 'pool.sks-keyservers.net'
  uri 'https://apt.releases.hashicorp.com'
  action [:create, :update]
end

The filter has not been updated:

~$ aptly mirror show hashicorp-bionic-main
Name: hashicorp-bionic-main
Archive Root URL: https://apt.releases.hashicorp.com/
Distribution: bionic
Components: main
Architectures: amd64
Download Sources: no
Download .udebs: no
Filter: consul (>= 1.8.1)
Filter With Deps: yes
Last update: 2020-08-14 16:27:04 UTC
Number of packages: 3

Information from release file:
Acquire-By-Hash: yes
Architectures: amd64 i386
Codename: bionic
Components: main
Date: Thu, 13 Aug 2020 16:37:20 UTC
Label: Artifactory
Origin: Artifactory
Suite: bionic

๐Ÿš“ Expected behavior

Aptly mirror filter expression should be updated, and updates should be downloaded.

Flexible config

It would be nice if you could pass arbitrary configs to the config file. You may want to publish to S3 or do something else that requires config beyond the basics the cookbook currently has. Perhaps the config should be driven by a resource that could take in a config hash.

Aptly mirror resource does not support the -ignore-signatures option

Cookbook version

current

Chef-client version

any

Platform Details

Any

Scenario:

Aptly does not currently support non-armored detached keys (aptly-dev/aptly#780) until 1.4.0 releases. This is an issue when trying to mirror the ubuntu cloud archive repo (aptly-dev/aptly#773). As we are unable to verify the keys with the current production release of aptly, and even the latest nightly release that's on the repo, ignoring the signature is the only way to mirror this repo using Aptly at all today.

See:
https://www.aptly.info/doc/aptly/mirror/create/
https://www.aptly.info/doc/aptly/mirror/update/

The above functions would need to incorporate this into the cookbook to make it work properly - some experimentation shows that simply doing aptly mirror create with -ignore-signatures and then trying to do aptly mirror update results in the update attempting to verify the signature anwyay.

Steps to Reproduce:

Look at https://github.com/sous-chefs/aptly/blob/master/resources/mirror.rb#L19-L32 and see there is no ignore_signatures property.

Expected Result:

Ability to ignore the signatures and use the repo anyway.

Actual Result:

Unable to do so using this cookbook.

HKPS key servers

Brief Description

When using an aptly_mirror resource it seems we cannot use a hkps server only hkp.

Cookbook version

2.0

Chef-Infra Version

Any

Platform details

Any

Steps To Reproduce

Steps to reproduce the behavior:

In aptly_mirror resource set to use keyserver keys.openpgp.org

Expected behavior

Aptly downloads key via hkps rather than hkp

Update Changelog

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

๐Ÿ‘ป Brief Description

Update all CHANGELOGs to follow standard defined at https://keepachangelog.com/

Issue sprouted from sous-chefs/meta/issues/101. If not applicable then issue should be closed.

aptly_mirror workflow is a bit flawed

Cookbook version

1.0.0

Chef-client version

13

Platform Details

Ubuntu 16.04

Scenario:

aptly_mirror has no way of updating it's own resource once in this example workflow below if I would use notifies :update, "aptly_mirror[chef-#{distro}]", :immediately. Would do a loop and continuously update itself.

As a workaround I added an execute resource to run the update action.

['bionic','xenial','trusty'].each do |distro|
  aptly_mirror "chef-#{distro}" do
    distribution distro
    component 'main'
    keyid '2940ABA983EF826A'
    keyserver 'keys.gnupg.net'
    uri 'https://packages.chef.io/stable-apt'
    filter 'chef (>= 12)'
    filter_with_deps true
    #notifies :update, "aptly_mirror[chef-#{distro}]", :immediately
    notifies :run, "execute[aptly-update-chef-#{distro}]", :immediately
    action [ :create ]
  end

  execute "aptly-update-chef-#{distro}" do
    command "aptly mirror update chef-#{distro}"
    user node['aptly']['user']
    group node['aptly']['group']
    environment aptly_env
    action :nothing
  end

  aptly_snapshot "chef-#{distro}" do
    from "chef-#{distro}"
    type 'mirror'
  end

  # ...
  # ...
end

Steps to Reproduce:

Using notifies :update, "aptly_mirror[chef-#{distro}]", :immediately like below:

  aptly_mirror "chef-#{distro}" do
    distribution distro
    component 'main'
    keyid '2940ABA983EF826A'
    keyserver 'keys.gnupg.net'
    uri 'https://packages.chef.io/stable-apt'
    filter 'chef (>= 12)'
    filter_with_deps true
    notifies :update, "aptly_mirror[chef-#{distro}]", :immediately
    action [ :create ]
  end

Expected Result:

Some way to force an update before running aptly_snapshot resource.

Actual Result:

See my workaround in the Scenario.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.