]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
[RM-16524] Add the --nogpgcheck option 404/head
authorWanlong Gao <wanlong.gao@easystack.cn>
Wed, 15 Jun 2016 03:00:57 +0000 (11:00 +0800)
committerWanlong Gao <wanlong.gao@easystack.cn>
Wed, 29 Jun 2016 12:29:32 +0000 (20:29 +0800)
I met the deploy failure with local mirror and the official gpgkeys,
the error is like:

[node-1][WARNIN]  Failing package is: 1:librbd1-0.94.6-0.el7.x86_64
[node-1][WARNIN]  GPG Keys are configured as: file:///opt/ceph-deploy/repo/release.asc

Anyway, I do not care the gpg keys but want to install successfully
without gpgcheck.

Signed-off-by: Wanlong Gao <wanlong.gao@easystack.cn>
ceph_deploy/hosts/centos/install.py
ceph_deploy/hosts/fedora/install.py
ceph_deploy/hosts/rhel/install.py
ceph_deploy/hosts/suse/install.py
ceph_deploy/install.py
ceph_deploy/util/templates.py

index 260a71c552e24278258f15b41a2aad575b8bc8c2..8eb05a1e6e1abc3908ed73aaa5f69f9ade97c185 100644 (file)
@@ -43,6 +43,8 @@ def install(distro, version_kind, version, adjust_repos, **kw):
         NON_SPLIT_PACKAGES,
         kw.pop('components', [])
     )
+
+    gpgcheck = kw.pop('gpgcheck', 1)
     logger = distro.conn.logger
     release = distro.release
     machine = distro.machine_type
@@ -96,7 +98,8 @@ def install(distro, version_kind, version, adjust_repos, **kw):
                     version=version),
                 gpg.url(key),
                 adjust_repos=True,
-                extra_installs=False
+                extra_installs=False,
+                gpgcheck=gpgcheck,
             )
 
         else:
@@ -117,6 +120,7 @@ def mirror_install(distro, repo_url, gpg_url, adjust_repos, extra_installs=True,
         kw.pop('components', [])
     )
     repo_url = repo_url.strip('/')  # Remove trailing slashes
+    gpgcheck = kw.pop('gpgcheck', 1)
 
     distro.packager.clean()
 
@@ -125,7 +129,8 @@ def mirror_install(distro, repo_url, gpg_url, adjust_repos, extra_installs=True,
 
         ceph_repo_content = templates.ceph_repo.format(
             repo_url=repo_url,
-            gpg_url=gpg_url
+            gpg_url=gpg_url,
+            gpgcheck=gpgcheck,
         )
 
         distro.conn.remote_module.write_yum_repo(ceph_repo_content)
index 11ce68860296990b336501732bf4977bd57de3de..b2806f4e2e98289ec70a74fc5b05e1c0fe088649 100644 (file)
@@ -12,6 +12,8 @@ def install(distro, version_kind, version, adjust_repos, **kw):
         NON_SPLIT_PACKAGES,
         kw.pop('components', [])
     )
+    gpgcheck = kw.pop('gpgcheck', 1)
+
     logger = distro.conn.logger
     release = distro.release
     machine = distro.machine_type
@@ -73,7 +75,8 @@ def install(distro, version_kind, version, adjust_repos, **kw):
                     version=version),
                 gpg.url(key),
                 adjust_repos=True,
-                extra_installs=False
+                extra_installs=False,
+                gpgcheck=gpgcheck,
             )
 
         else:
index 8c3c9d9d224f04e477005e038c5e8926ecc9f7fe..bf44a03999dde0d236b662d6398df5e3193b48ea 100644 (file)
@@ -11,6 +11,7 @@ def mirror_install(distro, repo_url,
                    gpg_url, adjust_repos, extra_installs=True, **kw):
     packages = kw.get('components', [])
     repo_url = repo_url.strip('/')  # Remove trailing slashes
+    gpgcheck = kw.pop('gpgcheck', 1)
 
     distro.packager.clean()
 
@@ -19,7 +20,8 @@ def mirror_install(distro, repo_url,
 
         ceph_repo_content = templates.ceph_repo.format(
             repo_url=repo_url,
-            gpg_url=gpg_url
+            gpg_url=gpg_url,
+            gpgcheck=gpgcheck,
         )
 
         distro.conn.remote_module.write_yum_repo(ceph_repo_content)
index db97071826f836ca9d112986feace6ee955734ee..7a23f3857299f867e7e4451817ea89c1cb7c8a46 100644 (file)
@@ -27,6 +27,7 @@ def mirror_install(distro, repo_url, gpg_url, adjust_repos, **kw):
     )
     repo_url = repo_url.strip('/')  # Remove trailing slashes
     gpg_url_path = gpg_url.split('file://')[-1]  # Remove file if present
+    gpgcheck = kw.pop('gpgcheck', 1)
 
     if adjust_repos:
         remoto.process.run(
@@ -40,7 +41,8 @@ def mirror_install(distro, repo_url, gpg_url, adjust_repos, **kw):
 
         ceph_repo_content = templates.zypper_repo.format(
             repo_url=repo_url,
-            gpg_url=gpg_url
+            gpg_url=gpg_url,
+            gpgcheck=gpgcheck,
         )
         distro.conn.remote_module.write_file(
             '/etc/zypp/repos.d/ceph.repo',
index bd4df20327b512300182edfb68f1a808613b7292..66ffe7def3853d4523e29257239f6a7a179ed242 100644 (file)
@@ -85,6 +85,9 @@ def install(args):
     if args.repo:
         return install_repo(args)
 
+    if args.nogpgcheck:
+        gpgcheck = 0
+
     if args.version_kind == 'stable':
         version = args.release
     else:
@@ -171,6 +174,7 @@ def install(args):
                 gpg_url,
                 args.adjust_repos,
                 components=components,
+                gpgcheck=gpgcheck,
             )
 
         # Detect and install custom repos here if needed
@@ -185,6 +189,7 @@ def install(args):
                 version,
                 args.adjust_repos,
                 components=components,
+                gpgcheck = gpgcheck,
             )
 
         # Check the ceph version we just installed
@@ -584,6 +589,12 @@ def make(parser):
                 (defaults to ceph.com)'
     )
 
+    parser.add_argument(
+        '--nogpgcheck',
+        action='store_true',
+        help='install packages without gpgcheck',
+    )
+
     parser.set_defaults(
         func=install,
     )
index 932123a39a292688253801b0c43cfc15b1797a0f..b54f7acb491bd52929f4499b3f651d568b18b229 100644 (file)
@@ -4,7 +4,7 @@ ceph_repo = """[ceph]
 name=Ceph packages for $basearch
 baseurl={repo_url}/$basearch
 enabled=1
-gpgcheck=1
+gpgcheck={gpgcheck}
 priority=1
 type=rpm-md
 gpgkey={gpg_url}
@@ -13,7 +13,7 @@ gpgkey={gpg_url}
 name=Ceph noarch packages
 baseurl={repo_url}/noarch
 enabled=1
-gpgcheck=1
+gpgcheck={gpgcheck}
 priority=1
 type=rpm-md
 gpgkey={gpg_url}
@@ -22,7 +22,7 @@ gpgkey={gpg_url}
 name=Ceph source packages
 baseurl={repo_url}/SRPMS
 enabled=0
-gpgcheck=1
+gpgcheck={gpgcheck}
 type=rpm-md
 gpgkey={gpg_url}
 """
@@ -31,7 +31,7 @@ zypper_repo = """[ceph]
 name=Ceph packages
 type=rpm-md
 baseurl={repo_url}
-gpgcheck=1
+gpgcheck={gpgcheck}
 gpgkey={gpg_url}
 enabled=1
 """