]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
install --no-check-packages-signatures for test purposes wip-gitbuilder-host
authorLoic Dachary <ldachary@redhat.com>
Fri, 25 Sep 2015 17:44:44 +0000 (19:44 +0200)
committerLoic Dachary <ldachary@redhat.com>
Sat, 26 Sep 2015 10:06:00 +0000 (12:06 +0200)
When installing from repositories that are created dynamically within a
lab, verifying the packages signatures can be skipped. The
--no-check-packages-signatures configures the repositories to not
require package signatures verification during installation.

Signed-off-by: Loic Dachary <loic@dachary.org>
ceph_deploy/hosts/centos/install.py
ceph_deploy/hosts/debian/install.py
ceph_deploy/hosts/remotes.py
ceph_deploy/install.py

index fa20f39f8b867ecc224cf48986a5db57b676f5cf..1a721af03507a03f8298924675e8535e25a55104 100644 (file)
@@ -107,6 +107,10 @@ def install(distro, version_kind, version, adjust_repos, **kw):
         # set the right priority
         logger.warning('ensuring that /etc/yum.repos.d/ceph.repo contains a high priority')
         distro.conn.remote_module.set_repo_priority(['Ceph', 'Ceph-noarch', 'ceph-source'])
+        if kw['no_check_packages_signatures']:
+            distro.conn.remote_module.set_repo_gpgcheck(['Ceph', 'Ceph-noarch', 'ceph-source'],
+                                                        '/etc/yum.repos.d/ceph.repo',
+                                                        '0')
         logger.warning('altered ceph.repo priorities to contain: priority=1')
 
     if packages:
index 6f30941a595e4b1fdaa07e4213873f597c744066..7e19ae27f46cfb596e762169f25ef963b31e5bae 100644 (file)
@@ -27,7 +27,8 @@ def install(distro, version_kind, version, adjust_repos, **kw):
         protocol = 'https'
         if codename == 'wheezy':
             protocol = 'http'
-        distro.packager.add_repo_gpg_key(gpg.url(key, protocol=protocol))
+        if not kw['no_check_packages_signatures']:
+            distro.packager.add_repo_gpg_key(gpg.url(key, protocol=protocol))
 
         if version_kind == 'stable':
             url = 'http://download.ceph.com/debian-{version}/'.format(
@@ -55,9 +56,12 @@ def install(distro, version_kind, version, adjust_repos, **kw):
 
     # TODO this does not downgrade -- should it?
     if packages:
+        extra_install_flags=['-o', 'Dpkg::Options::=--force-confnew']
+        if kw['no_check_packages_signatures']:
+            extra_install_flags.append('--force-yes')
         distro.packager.install(
             packages,
-            extra_install_flags=['-o', 'Dpkg::Options::=--force-confnew']
+            extra_install_flags=extra_install_flags
         )
 
 
index b857cd3ead4610586a9f98aaf6e03b5420819733..41a25130ef682756531492bdc563364b149c4496 100644 (file)
@@ -65,17 +65,25 @@ def set_apt_priority(fqdn, path='/etc/apt/preferences.d/ceph.pref'):
 
 
 def set_repo_priority(sections, path='/etc/yum.repos.d/ceph.repo', priority='1'):
+    set_repo_key_value(sections, path, 'priority', priority)
+
+
+def set_repo_gpgcheck(sections, path='/etc/yum.repos.d/ceph.repo', gpgcheck='1'):
+    set_repo_key_value(sections, path, 'gpgcheck', gpgcheck)
+
+
+def set_repo_key_value(sections, path, key, value):
     Config = ConfigParser.ConfigParser()
     Config.read(path)
     Config.sections()
     for section in sections:
         try:
-            Config.set(section, 'priority', priority)
+            Config.set(section, key, value)
         except ConfigParser.NoSectionError:
             # Emperor versions of Ceph used all lowercase sections
             # so lets just try again for the section that failed, maybe
             # we are able to find it if it is lower
-            Config.set(section.lower(), 'priority', priority)
+            Config.set(section.lower(), key, value)
 
     with open(path, 'wb') as fout:
         Config.write(fout)
index 614a204d3bd990d76ad506ff14246681161ba0b6..5189112ba666437ac4299825ad02fa9be3feebb0 100644 (file)
@@ -184,6 +184,7 @@ def install(args):
                 args.adjust_repos,
                 components=components,
                 gitbuilder_host=args.gitbuilder_host,
+                no_check_packages_signatures=args.no_check_packages_signatures,
             )
 
         # Check the ceph version we just installed
@@ -609,6 +610,12 @@ def make(parser):
                 (defaults to ceph.com)'
     )
 
+    repo.add_argument(
+        '--no-check-packages-signatures',
+        action='store_true',
+        help='do not check the package signatures',
+    )
+
     parser.set_defaults(
         func=install,
     )