aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFiles
2022-03-17Version 4.1HEADv4.1masterSergey Poznyakoff4
Document the rex group command.
2022-03-16rex group drop: check number of argumentsSergey Poznyakoff1
2019-11-29Fix documentationSergey Poznyakoff2
(the 'group' command is not yet documented)
2019-11-29New subcommands for rex groupSergey Poznyakoff1
rex group swap - swap two stack entries rex group drop - drop a stack entry The command rex group show takes new options: -a,-all, to show all stack entries, and -H,--hosts, to show hosts along with the host group name. The options are mutually exclusive.
2019-11-29BugfixSergey Poznyakoff1
* rex: Clear config(default,selected) in ::hostproc::prologue, after it has been properly initialized and its content copied to config(hosts).
2019-11-28rex group: initial implementationSergey Poznyakoff2
Selected hosts and host groups are kept on a stack. The host group on top of the stack is the current one. The 'rex group' command is provided to maintain the host group stack. It takes four subcommands: git push NAME push current group selection on stack and select NAME as a new host group git pop pop current hostgroup selection off stack git show display the currently selected host group (and, optionally, hosts in it) git select COMMAND create a temporary unnamed hostgroup from hosts on which COMMAND exits with 0 status and push it on stack
2019-11-22Fix improper dereferenceSergey Poznyakoff1
2017-10-31Add function for overriding the PTR record from the rc file.Sergey Poznyakoff2
* rex (config::hostname): New function. * rex.man8: Document it.
2016-10-13BugfixSergey Poznyakoff1
Prefix unrecognized messages obtained in the INIT state with "ssh HOSTNAME". Fix behavior of --ignore-hosts with legacy configuration.
2016-10-01Version 4.0release-4.0Sergey Poznyakoff2
2016-09-24BugfixesSergey Poznyakoff1
* rex (::getopt::parse): Initialize group_id and group_def Don't use dict lappend (add_host_key_list): Catch eventual errors (rex_command,rex_copy_to,rex_list): Move --ignore-hosts to group global
2016-09-24Add NEWS to distributionSergey Poznyakoff1
2016-09-24Add NEWS fileSergey Poznyakoff2
2016-09-24Minor fixesSergey Poznyakoff2
2016-09-23Remove leftover debugSergey Poznyakoff1
2016-09-23Further improvements of command-line and rc parsersSergey Poznyakoff2
Restore priority of command-line settings over the rc * rex (version): Raise to 3.91 (optiondef): New global array. (throw_config_error) (catch_config_error): New functions. (option_set): New function. (::getopt::parse): Rewrite. Instead of taking option groups as positional arguments, accept the -group option which defines an option group. It takes two arguments: group ID and a list of group definitions. Return a dictionary where preprocessed options can be found. Calling [::getopt::run dict id] will apply the options from group ID. (::getopt::run): Take two arguments: the parse dictionary returned by ::getopt::parse, and the ID of the option group to run. All uses updated. (rex_parse_cmdline): Use three option groups: initial, which is run before parsing anything else, global, which is parsed after sourcing main rc file, and mode, which is parsed after sourcing hostgroup rc. (::config::host): Append to the hostlist variable, instead of the legacy hosts, to avoid triggering the deprecation warning. (::config::locus): New function. (::config::*): Use ::config::locus for diagnostic purposes. (::config::read): Catch and process custom rex throws. (common_config_setup): Remove. (runcmd): Process password authentication for files passed with -D * rex.man8: Update.
2016-09-19Revamp rc file support.Sergey Poznyakoff1
While improving rc file support and making it (hopefully) more convenient, this commit alters the priority of rc ws. command line settings. This will be reverted in future commits. * rex (::getopt::parse): New option -postprocess. When given, supplies the name of a function to be called after parsing command line. The function returns a list of triplets: {option line file}, where option is a (list of) option and eventual argument, line and file give the location of the corresponding statement in the rc file. The list is then processed by calls to ::getopt::getopt, one call per option. (::config): Deprecate the old way of setting configuration variables. Provide functions for each particular setting, that make rc file look more or less like a traditional UNIX configuration file, while still providing possibility for using full strength of TCL. Catch and process syntax errors. (modetrans): New array. Translates various spellings of the mode argument to ensure config(mode) is set uniformly.
2016-09-17Minor fixSergey Poznyakoff1
2016-09-17Code cleanupSergey Poznyakoff1
* rex (::job): New namespace; provides functions for keeping track of the created ssh/scp jobs. (runcp,runcprev,runcmd,rex_login): Rewrite using job ensemble functions. (closeproc,transition): Remove. (add_host_key_list): Rewrite. (hostuser,hostpass): Fix interactive mode. (rexdbput): Bugfix
2016-09-17Take into account that ::pmres::resolve can return multiple valuesSergey Poznyakoff1
2016-09-16Improve error handling and reportingSergey Poznyakoff3
Use StrictHostKeyChecking=yes to avoid problems with eventual interactive prompts from ssh/scp. Use LogLevel=VERBOSE to correctly determine whether we succeeded in authenticating to the server. Catch error output from ssh/scp in INIT state. If any appears, reflect it on the standard error and mark error for that host. * README: Reword intro * rex (max_scp_retry_count): Remove config setting. (terror): Take optional argument -nosave. (warning): Pass -nosave in call to terror (hostpass): Throw error if no password defined. All uses updated. (runcp,runcmd): Force StrictHostKeyChecking=yes and LogLevel=VERBOSE. Catch state changes. Reflect on stderr whatever received in INIT state. Raise error state if anything was. (runcprev): Rewrite using state machine similar to runcp. (rex_login): Rewrite using state machine similar to runcmd. Catch errors. Honor -Z option and earlycmd settings. (closeproc): Log state transition. (transition): Log state transition. Call hook if defined. * rex.man8: Update.
2016-09-16Further improvement of tempfile creationSergey Poznyakoff1
* rex (tempfile): New function. (maketempfile): Rewrite using tempfile. Return channel ID. Store filename in an upvar. All uses changed.
2016-09-15Improve tempfile handlingSergey Poznyakoff1
* rex (maketempfile): Rewrite. Return {fd name}. All callers changed. (forgettempfile): New function. (rex_command,rex_copy_to) (rex_login): Remove calls to cleanup. (MAIN): Call cleanup here
2016-09-15Create temporary script if a pipeline or control flow statement is used in ↵Sergey Poznyakoff1
sudo mode. Earlier versions used to create a temporary script wherever a pipe symbol or whitespace had been found in the command line. This was an overkill, and was removed in ff1b746d. However, this approach is still needed, if a pipeline or shell control structure is passed as command in sudo mode. This commit restores it for such cases. Another way would be to run /bin/sh -c 'cmd', but that requires a careful preprocessing of cmd, so I prefer a temporary, at least for the time being. * rex (maketempfile): Register the created file in the global list for further removal before exiting. (editdb): Setting trap not needed now. (cleanup): Remove files listed in cleanup_files (ispipeline): New function (rex_command): Fall back to copy mode when passing what looks like a pipeline or control flow statement in sudo mode. (MAIN): Set trap.
2016-09-15Expand {N} within string arguments.Sergey Poznyakoff1
2016-09-14BugfixesSergey Poznyakoff2
* install: Fix missing dereference * rex (runcmd): Use -f option when cleaning up temporary directory.
2016-09-14Update docsSergey Poznyakoff2
2016-09-14Improve installerSergey Poznyakoff3
* install: Install packages * rc.tcl: Remove. * rex.exp: Rename back to rex * README: Update. * README-hacking: Update.
2016-09-13Create packages from vpnc and entrustcardSergey Poznyakoff6
2016-09-13Expand {N} and {} to the filename parts of the corresponding files.Sergey Poznyakoff2
* rex.exp: Prefer quoted conditionals; Expand {N} and {} to filename parts. * rex.man8: Clarify the semantics of {} and {N}
2016-09-12Minor changes in manpageSergey Poznyakoff1
2016-09-12Update list of ignored files.Sergey Poznyakoff1
2016-09-12Discontinue autotools-based install; provide custom installation script in TCLSergey Poznyakoff7
* install: New file. * GNUmakefile: Rewrite. * Makefile.am: Remove. * configure.ac: Remove. * README-hacking: Update * README: Update. * rex.exp: Use absolute paths for namespaces.
2016-09-10Improve db lookupsSergey Poznyakoff2
2016-09-10Get rid of lappend2Sergey Poznyakoff1
2016-09-10Implement rex copy --sudoSergey Poznyakoff2
* rex.exp (runcp): Turn off log_user. Handle permission denied errors. (rex_copy_to): New option: --sudo (main): Remove leftover debugging hook. * rex.man8: Update.
2016-09-09More fixes in docsSergey Poznyakoff1
2016-09-09Minor fix in docsSergey Poznyakoff1
2016-09-09Remove apparently useless "obfuscate" commandSergey Poznyakoff1
2016-09-09Change command line syntax.Sergey Poznyakoff2
The new syntax is: rex [OPTIONS] COMMAND [ARGS...] The COMMAND specifies the action to take. Valid values are: run, command run command on a set of server cp, copy copy (distribute) files to a set of servers rcp, copy-from copy files from a server login log in to a server list list available hostgroups or servers in a hostgroup edit edit rex database file encrypt, obfuscate convert text to a form suitable for keeping passwords in the rex database file This is incompatible change. Another important change: scripts transferred to target machines can be written in whatever scripting language, provided they start with the proper shebang marker, or the --interpeter option is used. * rex.exp (version): Set 3.90 (config_option): Take second optional argument. (getopt::parse): Alternative interface. (prusage,shortopts,longopts): Remove Use ::getopt::parse to parse options. (hostlist_setup): Additional functionality. (common_config_setup,cleanup) (getiterpreter): New functions. (rex_command,rex_list,rex_copy_from) (rex_copy_to,rex_login,rex_editdb) (rex_obfuscate): New functions (main): Expect first word in the command line to be the command. (hostproc::load): New function. (rexdbget): New option -return. All uses updated. (getans): Bugfix (hostuser): Check for env(USER). All uses updated. * rex.man8: Update
2016-09-07Move getopt to a separate namespaceSergey Poznyakoff1
2016-09-07Code and docs cleanupSergey Poznyakoff3
* rex.exp: Improve the handling of the -s option: mark it as requiring argument, instead of getting the first word from the $argv list; provide long option equivalent (--source). (argcvshift): New function. Use to shift the first word from $argv/$argc. (moresid): Remove unused function. Remove unused code left over after ff1b746d. * rex.man8: Update. * ChangeLog.amend: Update.
2016-09-06Clean up operation selection codeSergey Poznyakoff2
The operation mode is kept in config(mode). A switch is used to select the code block corresponding to the mode. Main loop is moved to a separate function. Two new options are introduced: --verbose enables additional warnings, and --shell starts interactive shell (same as "rex shell host"), actually.
2016-09-06Make pmres self-containedSergey Poznyakoff2
* rex.exp (pmres::host_order_cache): New variable (pmres::hostorder): Use host_order_cache instead of config(hostorder) * rex.man8: Update.
2016-09-06Clean up the config namespaceSergey Poznyakoff1
2016-09-04Use {*} where appropriate; fix rex --cpSergey Poznyakoff2
2016-09-04Cleanup namespacesSergey Poznyakoff1
2016-09-02Spell checkingSergey Poznyakoff1
2016-09-02Fix typo in vpnc.expSergey Poznyakoff1
2016-09-02Move hostgroups into ~/.rex/hostgroup subdirectorySergey Poznyakoff1
Note: breaks backward compatibility. * rex.exp (listgroups): Sort groups in lexicographic order (main): Look up rc file in the $dir/hostgroup/[config_option hostgroup] directory

Return to:

Send suggestions and report system problems to the System administrator.