Age | Commit message (Collapse) | Author | Files |
|
Document the rex group command.
|
|
|
|
(the 'group' command is not yet documented)
|
|
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.
|
|
* rex: Clear config(default,selected) in ::hostproc::prologue,
after it has been properly initialized and its content copied
to config(hosts).
|
|
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
|
|
|
|
* rex (config::hostname): New function.
* rex.man8: Document it.
|
|
Prefix unrecognized messages obtained in the INIT state with "ssh HOSTNAME".
Fix behavior of --ignore-hosts with legacy configuration.
|
|
|
|
* 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
|
|
|
|
|
|
|
|
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.
|
|
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.
|
|
|
|
* 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
|
|
|
|
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.
|
|
* rex (tempfile): New function.
(maketempfile): Rewrite using tempfile. Return channel ID.
Store filename in an upvar. All uses changed.
|
|
* 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
|
|
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.
|
|
|
|
* install: Fix missing dereference
* rex (runcmd): Use -f option when cleaning up
temporary directory.
|
|
* install: Install packages
* rc.tcl: Remove.
* rex.exp: Rename back to rex
* README: Update.
* README-hacking: Update.
|
|
|
|
Allow to use multiple hostnames (comma-delimited list).
Improve docs.
|
|
* rex: New options: -I (--ignore-hosts) and -q (--no-init-file).
Normalize the config(option,*) namespace.
* rex.8: Update.
|
|
|
|
New option -Z (--zsh-quirk) provides an ad-hoc way of coping with
hosts running zsh. The earlycmd configuration setting provides a
generalized way of doing so.
* rex (hostearlycmd): New function.
(-Z, --zsh-quirk): New option.
(listgroups): Try to disable zsh/zle and reset password if no
prompt has been detected within a timeout and -Z option is set.
Send the earlycmd (if defined) upon seeing the first line of output.
* rex.8: Document changes
|
|
* rex (closeproc): Use upvar to access the sidlist.
(runcmd): Use single expect loop. Fix the use
of expect_out(spawn_id). This fixes the handling
of timeout.
Note that $config{program} is now invoked once for
each successful job in the batch.
|
|
|
|
|
|
* rex (runcmd): Add missing sigil.
Fix -X functionality in case when resolve returns multiple
names/ips.
|
|
* rex (config): Set option,resolve to 1
(::pmres::resolve): Cache results.
(hostname): New function.
(runcmd): Use [hostname] to print hostnames.
* rex.8: Document new options.
|
|
* rex (runcp): Expect on all ids in sidlist
|
|
Useful together with -j to prevent intermixing of output lines
received from different servers.
|
|
* rex (config): Initialize option,jobs to 1
(prusage): list new options
(runcp,runcmd): first argument is the list of hosts
(shortopts,longopts): New option: -j, --jobs
(main): process hosts in bunches, $config(option,jobs) hosts
per each
* rex.8: Update.
|
|
* Makefile: Update version number
* rex (editdb): unlink temporary file on signal
(runcmd): Don't print host header if no_host_header
option is set.
(longopts): New option --no-host-header
* vpnc.exp: Minor change
|
|
* rex: Raise version to 2.1
New option --prefix (-P).
(runcmd): log_user setting depends only on the --log option.
Revamp expect loop to process output line by line.
Remove carriage returns before printing output lines.
Optionally prefix output lines with the name of the host.
* rex.8: Update.
|
|
* rex (ispasswd): New function
(mkdbview,svdbview): Use ispasswd to select keys that should
be encrypted.
(dbchanged): New function.
(editdb): Allow for nonexisting db file.
Do not call whatnow if the database hasn't changed.
(main); Use $usrconfdir/db as a default database. Create
the directory if it does not exist, if the user confirms.
|
|
|
|
|
|
* rex: New option --copy-from.
* rex.8: Manpage template.
|
|
* rex: Implement a simplistic DNS resolver. Use it when looking up
host-specific keys in the database.
* vpnc.exp (startvpnc): Ignore SIGHUP.
|
|
* rex: Change libpath
(writedb): Use maketempfile to create a temporary file.
(mkdbview,svdbview): Fix conditionals.
(editdb): Add a global decl for env.
* vpnc.exp (startvpnc): Set default value for pidfile.
|
|
* rex (terror): New function. Use it to report errors.
(runcp,runcprev): Do not exit on errors.
(runcmd): Handle "*\r" and "*\n" in the final expect to
reset timeout.
(main): Report errors at the end of the run. Return 2
to the shell if they occurred.
|
|
* rex (rexdbget,rexdbput): Use info to test for the hostgroup
option.
(rexdbclr): Likewise. Also, unset both the qualified and
unqualified key.
|
|
* rex (maketempfile): New function.
(prusage): Sort options alphabetically.
(editdb): Use maketempfile. Redirect streams in exec.
(main): Use maketempfile.
|