Skip to content

Instantly share code, notes, and snippets.

@tbielawa
Created March 6, 2014 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tbielawa/9393928 to your computer and use it in GitHub Desktop.
Save tbielawa/9393928 to your computer and use it in GitHub Desktop.

juicer-admin(1)

NAME

juicer-admin - manage pulp repositories, users, and roles.

SYNOPSIS

juicer-admin [-vvv] [-V] command subcommand [PARAMETERS …​] [OPTIONS …​] [--in env …​]

DESCRIPTION

Manage pulp repositories, users, and roles.

COMMON OPTIONS

-v, --verbose

Increase the verbosity (up to 3x). In usage specify -v before COMMAND.

-V, --version

Print the version that you’re using of juicer-admin.

--in env …​

Specify which environment(s) to perform the SUBCOMMAND in. In juicer-admin(1) usage, all SUBCOMMANDs accept this option when given after SUBCOMMAND.

REPO SUBCOMMANDS

This section describes all of the REPO subcommands.

REPO CREATE

usage: juicer-admin repo create REPONAME [--feed FEED] [--checksum-type TYPE]

REPONAME

The name of the repository to be created. Only alphanumeric, ., -, and _ allowed. As a regular expression: ([a-zA-Z0-9-_.]+)

--feed=FEED

Optional. A feed url from which to synchronize yum repository packages.

--checksum-type=CHECKSUM_TYPE

Optional. The checksum type to use when generating meta-data. Defaults to sha256, also valid is sha.

REPO IMPORT

usage: juicer-admin repo import REPO_DEF [--noop]

Create repositories matching the definitions in the repo def file. Repositories which already exist will be updated if necessary.

Note this command can take a long time to complete.

REPO_DEF

Repository definition file in JSON format. See REPO DEF FORMAT (below) for a quick review of the syntax. See the docs online or in /usr/share/doc/juicer*/repo_syntax.md for a detailed description.

--noop, --dry-run, -n

Don’t create the repos, just show what would have happened.

Note: This command does not respect --in

REPO EXPORT

usage: juicer-admin repo export [--out OUT] [--pretty]

This dumps a standard juicer format repository definition for all of you repos. Note that this may take a long time to finish. However, the runtime decreases linearly in relation to the number of CPUs available.

-o OUT,--out=OUT

Write the output to OUT. Use a single hypen, -, for stdout. Default is repodefs-datestamp.json. The datestamp is in ISO8601 format: YYYY-MM-DDTHH:MM:SS[.mmmmmm][+HH:MM].

-p,--pretty

Pretty-print the export.

Note: Unlike the IMPORT command, this command does respect --in

REPO DELETE

usage: juicer-admin repo delete REPONAME

Delete a pulp repository. The repository will be deleted in all environments if you do not specify --in.

REPONAME

Name of repository which will be deleted

REPO LIST

usage: juicer-admin repo list [--json]

List all of the repos in any or all environments.

--json

Optional. Return the data in JSON format.

REPO SHOW

usage: juicer-admin repo show REPONAME […​] [--json]

Show basic statistics in table format about one or more repos in pulp.

REPONAME

Name of the repository to show. Separate multiple REPONAME parameters with spaces.

--json

Optional. Return the data in JSON format.

Examples:

  • juicer-admin repo show demo-repo

Name Environment RPM count SRPM count Checksum Type Feed

demo-repo

QA

1337

0

sha256

None

  • Show a few repos, in json format, only in dev and stage

    juicer-admin repo show repo01 repo02 repo04 --in dev stage --json

REPO SYNC

usage: juicer-admin repo sync NAME

Syncs content into repository NAME from a feed source. This call always executes asynchronously. The feed source is defined at repository creation time.

NAME

Name of repository to sync

USER SUBCOMMANDS

This section describes all of the USER subcommands.

USER CREATE

usage: juicer-admin user create LOGIN --name FULLNAME --password PASSWORD

Create a user in the pulp system.

LOGIN

Login or username

--name=FULLNAME

User’s full name

--password=PASSWORD

Plain text password. Will prompt if no arg specified

USER DELETE

usage: juicer-admin user delete LOGIN

Delete the LOGIN account. The account will be deleted in all environments if you do not specify --in.

LOGIN

The login or username of user which will be deleted

USER LIST

usage: juicer-admin user list

Print out the users in each environment, as well as their associated roles.

USER SHOW

usage: juicer-admin user show LOGIN

Print the Login, Name, and Role of LOGIN in each environment.

LOGIN

The login for the user to show

USER UPDATE

usage: juicer-admin user update LOGIN { [--name FULLNAME] | [--password PASSWORD] }

Update the FULLNAME and/or PASSWORD for the LOGIN account. One of --name or --password is required. Providing both is not necessary, but valid.

LOGIN

Login or username of user which will be updated

--name=FULLNAME

Updated full name

--password=PASSWORD

Updated plain text password. Will prompt if no arg specified

ROLE SUBCOMMANDS

This section describes all of the ROLE subcommands.

ROLE LIST

usage: juicer-admin role list

For each environment, print summary information on each defined role. This information includes:

  • Name of the role

  • Description of the role

  • ID of the role

  • Users assigned the role

See the Pulp User documentation (SEE ALSO) for more information on the specifics of role management.

ROLE ADD

usage: juicer-admin role add --role ROLE --login LOGIN

Add the specified ROLE to the LOGIN account in the specified environments.

--role=ROLE

The role which will be assigned to login or username

--login=LOGIN

Login or username of user which will be added to role

See the Pulp User documentation (SEE ALSO) for more information on the specifics of role management.

REPO DEF FORMAT

Mandatory keys:

  • name (string)

Optional Keys:

  • feed (string)

  • checksum_type (string, one of: sha, sha256)

  • env (list of environment name strings)

Example:

[
    {"name": "repo01", "env": ["prod"]},
    {"name": "repo02"},
    {
        "name": "fedora_mirror",
        "feed": "http://download.fedoraproject.org/pub/fedora/linux/releases/20/Everything/x86_64/os/",
        "checksum_type": "sha",
        "env": ["dev", "prod"]
    }
]

Protips

  • Don’t end lists or hashes with trailing commas

  • Remember to close all of your braces and brackets: Each [ has a matching ], each { has a matching }

  • Use a javascript mode in your editor if it doesn’t have a native json mode

  • Setting env to an empty list ([]) will not delete the repo from any environment

  • Use a linting service if you’re stuck, for example: http://jsonlint.com/

FILES

~/.config/juicer/config — Juicer configuration file

~/.config/juicer/carts/ — Cart storage location

AUTHOR

Juicer was written by GCA-PC, Red Hat, Inc..

This man page was written by Tim Bielawa <tbielawa@redhat.com> and Andrew Butcher <abutcher@redhat.com>.

Copyright © 2012-2014, Red Hat, Inc..

Juicer is released under the terms of the GPLv3+ License.

SEE ALSO

juicer(1), juicer.conf(5)

Pulp User Documentation — http://www.pulpproject.org/docs/

The Juicer Homepage — https://github.com/juicer/juicer/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment