]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
add a --local--mirror flag for install
authorAlfredo Deza <alfredo.deza@inktank.com>
Thu, 5 Dec 2013 16:58:08 +0000 (11:58 -0500)
committerAlfredo Deza <alfredo.deza@inktank.com>
Thu, 17 Apr 2014 13:36:10 +0000 (09:36 -0400)
Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
ceph_deploy/install.py

index f7fbccabdde341e1bbc9a24c3b314d470659d3c7..2ca27c86c4a2657f3f890fc9383f75a45090417b 100644 (file)
@@ -56,6 +56,12 @@ def install(args):
             LOG.warning('using GPG fallback: %s', gpg_fallback)
             gpg_url = gpg_fallback
 
+        if args.local_mirror:
+            from .lib.remoto import rsync
+            rsync(hostname, args.local_mirror, '/opt/ceph-deploy/repo', distro.conn.logger, sudo=True)
+            repo_url = 'file:///opt/ceph-deploy/repo'
+            gpg_url = 'file:///opt/ceph-deploy/repo/release.asc'
+
         if repo_url:  # triggers using a custom repository
             # the user used a custom repo url, this should override anything
             # we can detect from the configuration, so warn about it
@@ -366,6 +372,14 @@ def make(parser):
         help='hosts to install on',
     )
 
+    parser.add_argument(
+        '--local-mirror',
+        nargs='?',
+        const='URL',
+        default=None,
+        help='Fetch packages and push them to hosts for a local repo mirror',
+    )
+
     parser.add_argument(
         '--repo-url',
         nargs='?',