B.3. Red Hat Network Configuration Manager
A diferencia del Red Hat Network Configuration Client, el Red Hat Network Configuration Manager (
rhncfg-manager
) está diseñado para mantener el repositorio central RHN de archivos y canales de configuración y no aquellos ubicados en los sistemas cliente. Esta herramienta ofrece una alternativa de línea de comandos para las funciones del gestor de configuración del sitio web de RHN, así como la posibilidad de crear un script de algunas o todas las funciones de mantenimiento relacionadas.
Este está destinado a los administradores Config y, de hecho, requiere un nombre de usuario y una contraseña RHN que contenga los permisos apropiados. El nombre de usuario puede especificarse en
/etc/sysconfig/rhn/rhncfg-manager.conf
o en la sección [rhncfg-manager] de ~/.rhncfgrc
.
Cuando el Red Hat Network Configuration Manager es ejecutado como root, éste trata de conseguir los valores de configuración que necesita del Red Hat Update Agent. Cuando se ejecute fuera de root, se tendrán que hacer algunos cambios de configuración en el archivo
~/.rhncfgrc
. El archivo de sesión está localizado en la cache como ~/.rhncfg-manager-session
para evitar el inicio de sesión para cada comando.
El tiempo límite predeterminado para el Red Hat Network Configuration Manager es 30 minutos. Para alterarlo, añada la opción
server.session_lifetime
y el nuevo valor al archivo /etc/rhn/rhn.conf
en el servidor que ejecuta el administrador, algo como:
server.session_lifetime = 120
server.session_lifetime = 120
El Red Hat Network Configuration Manager ofrece los siguientes modos primarios: añadir, crear-canal, diferencias, diferencia-revisiones, descargar-canal, obtener, lista, lista-canales, remover, remover-canal, revisiones, actualizar, y cargar-canal.
Cada modo ofrece sus propias opciones. Éstas pueden ser vistas al ejecutar el comando siguiente:
rhncfg-manager mode --help
rhncfg-manager mode --help rhncfg-manager mode --help rhncfg-manager mode --help
Remplace mode con el nombre del modo a ser inspeccionado:
rhncfg-manager diff-revisions --help
rhncfg-manager diff-revisions --help
Usted puede ver la lista de opciones del modo add en la Tabla B.4, “Opciones de
rhncfg-manager add
”.
B.3.1. Crear un canal Config Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
Para crear un canal de configuración para su organización, ejecute el comando:
rhncfg-manager create-channel channel-label
rhncfg-manager create-channel channel-label rhncfg-manager create-channel channel-label
Proporcione el nombre de usuario de RHN y la contraseña si éstas le son pedidas. La salida resultante debe asimilarse a:
Red Hat Network username: rhn-user Password: Creating config channel channel-label Config channel channel-label created
Red Hat Network username: rhn-user Password: Creating config channel channel-label Config channel channel-label created Red Hat Network username: rhn-user Password: Creating config channel channel-label Config channel channel-label created Red Hat Network username: rhn-user Password: Creating config channel channel-label Config channel channel-label created Red Hat Network username: rhn-user Password: Creating config channel channel-label Config channel channel-label created Red Hat Network username: rhn-user Password: Creating config channel channel-label Config channel channel-label created
Una vez creado un canal config, usted tiene los demás modos disponibles para poblar y mantener el canal.
B.3.2. Añadir archivos al canal Config Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
Para añadir un archivo al canal de configuración, especifique la etiqueta del canal, así como el archivo local que va a cargar; como en:
rhncfg-manager add --channel=channel-label /path/to/file
rhncfg-manager add --channel=channel-label /path/to/file rhncfg-manager add --channel=channel-label /path/to/file rhncfg-manager add --channel=channel-label /path/to/file rhncfg-manager add --channel=channel-label /path/to/file
Además de la etiqueta del canal requerido y la ruta del archivo, usted puede usar la opción disponible para modificar el archivo al momento de añadirlo. Por ejemplo, usted puede alterar la ruta y el nombre del archivo incluyendo la opción
--dest-file
en la línea de comandos, así:
rhncfg-manager add --channel=channel-label--dest-file=/new/path/to/file.txt/path/to/file
rhncfg-manager add --channel=channel-label--dest-file=/new/path/to/file.txt/path/to/file rhncfg-manager add --channel=channel-label--dest-file=/new/path/to/file.txt/path/to/file rhncfg-manager add --channel=channel-label--dest-file=/new/path/to/file.txt/path/to/file rhncfg-manager add --channel=channel-label--dest-file=/new/path/to/file.txt/path/to/file
Se verá algo similar a:
Pushing to channel example-channel Local file >/path/to/file -> remote file /new/path/to/file.txt
Pushing to channel example-channel Local file >/path/to/file -> remote file /new/path/to/file.txt
La siguiente tabla lista las opciones disponibles para
rhncfg-manager add
:
Opciones | Descripción |
---|---|
-cCHANNEL --channel=CHANNEL | Carga los archivos en este canal de configuración |
-dDEST_FILE --dest-file=DEST_FILE | Carga el archivo como esta ruta |
--delim-start=DELIM_START | Inicia el delimitador para la interpolación de variables. |
--delim-end=DELIM_END | Finaliza el delimitador para la interpolación de variables. |
-h, --help | Muestra el mensaje de ayuda y sale. |
Nota
Por defecto, el tamaño máximo para los archivos de configuración es 128KB. Si necesita cambiar ese valor, busque o cree la siguiente línea en el archivo
/etc/rhn/rhn.conf
:
web.maximum_config_file_size=128
web.maximum_config_file_size=128
Cambie el valor predeterminado de 128 con el valor que desee (en bytes).
B.3.3. Comparar los últimos archivos Config Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
Para obtener las diferencias entre los archivos de configuración en el disco y las últimas revisiones en un canal, ejecute el comando:
rhncfg-manager diff --channel=channel-label --dest-file=/path/to/file.txt \ /local/path/to/file
rhncfg-manager diff --channel=channel-label --dest-file=/path/to/file.txt \ /local/path/to/file rhncfg-manager diff --channel=channel-label --dest-file=/path/to/file.txt \ /local/path/to/file rhncfg-manager diff --channel=channel-label --dest-file=/path/to/file.txt \ /local/path/to/file rhncfg-manager diff --channel=channel-label --dest-file=/path/to/file.txt \ /local/path/to/file rhncfg-manager diff --channel=channel-label --dest-file=/path/to/file.txt \ /local/path/to/file rhncfg-manager diff --channel=channel-label --dest-file=/path/to/file.txt \ /local/path/to/file
Usted verá así:
/tmp/dest_path/example-config.txt /home/test/blah/hello_world.txt --- /tmp/dest_path/example-config.txt config_channel: example-channel revision: 1 +++ /home/test/blah/hello_world.txt 2003-12-14 19:08:59.000000000 -0500 @@ -1 +1 @@ -foo +hello, world
/tmp/dest_path/example-config.txt /home/test/blah/hello_world.txt --- /tmp/dest_path/example-config.txt config_channel: example-channel revision: 1 +++ /home/test/blah/hello_world.txt 2003-12-14 19:08:59.000000000 -0500 @@ -1 +1 @@ -foo +hello, world
La siguiente tabla lista las opciones disponibles para
rhncfg-manager diff
:
Opciones | Descripción |
---|---|
-cCHANNEL, --channel=CHANNEL | Obtiene el archivo(s) desde este canal de configuración |
-rREVISION, --revision=REVISION | Usa esta revisión |
-dDEST_FILE, --dest-file=DEST_FILE | Carga el archivo como esta ruta |
-tTOPDIR, --topdir=TOPDIR | Realiza todos los archivos relativos a esta cadena |
-h, --help | Muestra el mensaje de ayuda y sale. |
B.3.4. Comparar varias versiones Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
Para comparar diferentes versiones de un archivo a lo largo de canales y revisiones, utilice la opción
-r
para indicar qué revisión del archivo debe ser comparada y la opción -n
para identificar los dos canales que deben ser revisados. Consulte la Sección B.3.11, “Determinar el número de revisiones de un archivo” para obtener instrucciones relacionadas. Note que sólo se especifica un nombre de archivo, ya que usted está comparando el archivo con otra versión de sí mismo. Por ejemplo:
rhncfg-manager diff-revisions -n=channel-label1-r=1-n=channel-label2-r=1/path/to/file.txt
rhncfg-manager diff-revisions -n=channel-label1-r=1-n=channel-label2-r=1/path/to/file.txt rhncfg-manager diff-revisions -n=channel-label1-r=1-n=channel-label2-r=1/path/to/file.txt rhncfg-manager diff-revisions -n=channel-label1-r=1-n=channel-label2-r=1/path/to/file.txt rhncfg-manager diff-revisions -n=channel-label1-r=1-n=channel-label2-r=1/path/to/file.txt rhncfg-manager diff-revisions -n=channel-label1-r=1-n=channel-label2-r=1/path/to/file.txt rhncfg-manager diff-revisions -n=channel-label1-r=1-n=channel-label2-r=1/path/to/file.txt
Se verá algo similar a:
--- /tmp/dest_path/example-config.txt 2004-01-13 14:36:41 \ config channel: example-channel2 revision: 1 --- /tmp/dest_path/example-config.txt 2004-01-13 14:42:42 \ config channel: example-channel3 revision: 1 @@ -1 +1,20 @@ -foo +blaaaaaaaaaaaaaaah +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.0.6 (GNU/Linux) +Comment: For info see http://www.gnupg.org + +iD8DBQA9ZY6vse4XmfJPGwgRAsHcAJ9ud9dabUcdscdcqB8AZP7e0Fua0NmKsdhQCeOWHX +VsDTfen2NWdwwPaTM+S+Cow= +=Ltp2 +-----END PGP SIGNATURE-----
--- /tmp/dest_path/example-config.txt 2004-01-13 14:36:41 \ config channel: example-channel2 revision: 1 --- /tmp/dest_path/example-config.txt 2004-01-13 14:42:42 \ config channel: example-channel3 revision: 1 @@ -1 +1,20 @@ -foo +blaaaaaaaaaaaaaaah +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.0.6 (GNU/Linux) +Comment: For info see http://www.gnupg.org + +iD8DBQA9ZY6vse4XmfJPGwgRAsHcAJ9ud9dabUcdscdcqB8AZP7e0Fua0NmKsdhQCeOWHX +VsDTfen2NWdwwPaTM+S+Cow= +=Ltp2 +-----END PGP SIGNATURE-----
La siguiente tabla muestra las opciones disponibles para
rhncfg-manager diff-revisions
:
Opciones | Descripción |
---|---|
-cCHANNEL, --channel=CHANNEL | Utiliza este canal de configuración |
-rREVISION, --revision=REVISION | Usa esta revisión |
-h, --help | Muestra el mensaje de ayuda y sale. |
B.3.5. Descargar todos los archivos en un canal Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
Para descargar todos los archivos de un canal al disco, cree un directorio y ejecute el siguiente comando:
rhncfg-manager download-channel channel-label --topdir .
rhncfg-manager download-channel channel-label --topdir . rhncfg-manager download-channel channel-label --topdir . rhncfg-manager download-channel channel-label --topdir .
Se verá algo similar a:
Copying /tmp/dest_path/example-config.txt -> \ blah2/tmp/dest_path/example-config.txt
Copying /tmp/dest_path/example-config.txt -> \ blah2/tmp/dest_path/example-config.txt
La siguiente tabla lista las opciones disponibles para
rhncfg-manager download-channel
:
Opciones | Descripción |
---|---|
-tTOPDIR, --topdir=TOPDIR | Directorio de todas las rutas de archivos relativas a éste. Esta opción debe ser establecida. |
-h, --help | Muestra el mensaje de ayuda y sale. |
B.3.6. Obtener el contenido de un archivo Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
Para direccionar el contenido de un archivo particular a la salida estándar (stdout), ejecute el comando:
rhncfg-manager get --channel=channel-label \ /tmp/dest_path/example-config.txt
rhncfg-manager get --channel=channel-label \ /tmp/dest_path/example-config.txt rhncfg-manager get --channel=channel-label \ /tmp/dest_path/example-config.txt rhncfg-manager get --channel=channel-label \ /tmp/dest_path/example-config.txt
Usted debería ver el contenido del archivo como salida.
B.3.7. Listar todos los archivos en un canal Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
Para listar todos los archivos en un canal, ejecute el comando:
rhncfg-manager list channel-label
rhncfg-manager list channel-label rhncfg-manager list channel-label
Usted verá así:
Files in config channel `example-channel3': /tmp/dest_path/example-config.txt
Files in config channel `example-channel3': /tmp/dest_path/example-config.txt
La siguiente tabla lista las opciones disponibles para
rhncfg-manager get
:
Opciones | Descripción |
---|---|
-cCHANNEL, --channel=CHANNEL | Obtiene el archivo(s) desde este canal de configuración |
-tTOPDIR, --topdir=TOPDIR | Realiza todos los archivos relativos a esta cadena |
-rREVISION, --revision=REVISION | Obtiene esta revisión de archivo |
-h, --help | Muestra el mensaje de ayuda y sale. |
B.3.8. Listar todos los canales Config Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
Para listar todos los canales de configuración de su organización, ejecute el comando:
rhncfg-manager list-channels
rhncfg-manager list-channels
Se verá algo similar a:
Available config channels: example-channel example-channel2 example-channel3 config-channel-14 config-channel-17
Available config channels: example-channel example-channel2 example-channel3 config-channel-14 config-channel-17
Note que los canales
local_override
o server_import
no son listados.
B.3.9. Eliminar un archivo de un canal Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
Para eliminar un archivo de un canal, ejecute el comando:
rhncfg-manager remove --channel=channel-label /tmp/dest_path/example-config.txt
rhncfg-manager remove --channel=channel-label /tmp/dest_path/example-config.txt rhncfg-manager remove --channel=channel-label /tmp/dest_path/example-config.txt rhncfg-manager remove --channel=channel-label /tmp/dest_path/example-config.txt rhncfg-manager remove --channel=channel-label /tmp/dest_path/example-config.txt
Proporcione el nombre de usuario de RHN y la contraseña si éstas le son pedidas. Debería ver algo así:
Red Hat Network username: rhn-user Password: Removing from config channel example-channel3 /tmp/dest_path/example-config.txt removed
Red Hat Network username: rhn-user Password: Removing from config channel example-channel3 /tmp/dest_path/example-config.txt removed
La siguiente tabla lista las opciones disponibles para
rhncfg-manager remove
:
Opciones | Descripción |
---|---|
-cCHANNEL, --channel=CHANNEL | Elimina archivos de este canal de configuración |
-tTOPDIR, --topdir=TOPDIR | Realiza todos los archivos relativos a esta cadena |
-h, --help | Muestra el mensaje de ayuda y sale. |
B.3.10. Borrar un canal Config Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
Para borrar un canal de configuración en su organización, ejecute el comando:
rhncfg-manager remove-channel channel-label
rhncfg-manager remove-channel channel-label rhncfg-manager remove-channel channel-label rhncfg-manager remove-channel channel-label
Se verá algo similar a:
Removing config channel example-channel Config channel example-channel removed
Removing config channel example-channel Config channel example-channel removed
B.3.11. Determinar el número de revisiones de un archivo Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
Para determinar cuántas revisiones (las revisiones van de 1 hasta N siendo N un integral mayor que 0) de un archivo/ruta hay en un canal, ejecute el siguiente comando:
rhncfg-manager revisions channel-label /tmp/dest_path/example-config.txt
rhncfg-manager revisions channel-label /tmp/dest_path/example-config.txt rhncfg-manager revisions channel-label /tmp/dest_path/example-config.txt rhncfg-manager revisions channel-label /tmp/dest_path/example-config.txt
Se verá algo similar a:
Analyzing files in config channel example-channel \ /tmp/dest_path/example-config.txt: 1
Analyzing files in config channel example-channel \ /tmp/dest_path/example-config.txt: 1
B.3.12. Actualizar un archivo en un canal Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
Para crear una nueva revisión de un archivo en un canal (o para añadir la primera revisión a ese canal en caso de no existir ninguna), ejecute el siguiente comando:
rhncfg-manager update \ --channel=channel-label --dest-file=/path/to/file.txt /local/path/to/file
rhncfg-manager update \ --channel=channel-label --dest-file=/path/to/file.txt /local/path/to/file rhncfg-manager update \ --channel=channel-label --dest-file=/path/to/file.txt /local/path/to/file rhncfg-manager update \ --channel=channel-label --dest-file=/path/to/file.txt /local/path/to/file rhncfg-manager update \ --channel=channel-label --dest-file=/path/to/file.txt /local/path/to/file rhncfg-manager update \ --channel=channel-label --dest-file=/path/to/file.txt /local/path/to/file rhncfg-manager update \ --channel=channel-label --dest-file=/path/to/file.txt /local/path/to/file
Se verá algo similar a:
Pushing to channel example-channel: Local file example-channel/tmp/dest_path/example-config.txt -> \ remote file /tmp/dest_path/example-config.txt
Pushing to channel example-channel: Local file example-channel/tmp/dest_path/example-config.txt -> \ remote file /tmp/dest_path/example-config.txt
La siguiente tabla lista las opciones disponibles para
rhncfg-manager update
:
Opciones | Descripción |
---|---|
-cCHANNEL, --channel=CHANNEL | Carga los archivos en este canal de configuración |
-dDEST_FILE, --dest-file=DEST_FILE | Carga el archivo como esta ruta |
-tTOPDIR, --topdir=TOPDIR | Realiza todos los archivos relativos a esta cadena |
--delim-start=DELIM_START | Inicia el delimitador para la interpolación de variables. |
--delim-end=DELIM_END | Finaliza el delimitador para la interpolación de variables. |
-h, --help | Muestra el mensaje de ayuda y sale. |
B.3.13. Cargar múltiples archivos al mismo tiempo Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
Para cargar al mismo tiempo múltiples archivos a un canal de configuración desde el disco local, ejecute el comando:
rhncfg-manager upload-channel --topdir=topdir channel-label
rhncfg-manager upload-channel --topdir=topdir channel-label rhncfg-manager upload-channel --topdir=topdir channel-label rhncfg-manager upload-channel --topdir=topdir channel-label rhncfg-manager upload-channel --topdir=topdir channel-label
Se verá algo similar a:
Using config channel example-channel4 Uploading /tmp/ola_world.txt from blah4/tmp/ola_world.txt
Using config channel example-channel4 Uploading /tmp/ola_world.txt from blah4/tmp/ola_world.txt
La siguiente tabla muestra las opciones disponibles para
rhncfg-manager upload-channel
:
Opciones | Descripción |
---|---|
-tTOPDIR, --topdir=TOPDIR | Directorio de todos las rutas de archivos relacionadas con éste. |
-cCHANNEL, --channel=CHANNEL | Lista los canales en los cuales será cargada la información de configuración. Los canales están delimitados por ','. Por ejemplo: --channel=foo,bar,baz |
-h, --help | Muestra el mensaje de ayuda y sale. |