| |
@@ -65,6 +65,17 @@
|
| |
DEF_USER = "root"
|
| |
DEF_PASSWD = "foobar"
|
| |
DEF_HOST = "127.0.0.3"
|
| |
+ # configure sshd to use UseDNS no to fix broken EL7 systems
|
| |
+ BOOTCMD_SSHD_USEDNS_NO = """bootcmd:
|
| |
+ - |
|
| |
+ if grep -q '^UseDNS' /etc/ssh/sshd_config; then
|
| |
+ sed 's/^UseDNS.*$/UseDNS no/' -i /etc/ssh/sshd_config
|
| |
+ elif grep -q '^#UseDNS' /etc/ssh/sshd_config; then
|
| |
+ sed 's/^#UseDNS.*$/UseDNS no/' -i /etc/ssh/sshd_config
|
| |
+ else
|
| |
+ echo "UseDNS no" >> /etc/ssh/sshd_config
|
| |
+ fi
|
| |
+ """
|
| |
USER_DATA = """#cloud-config
|
| |
users:
|
| |
- default
|
| |
@@ -485,6 +496,8 @@
|
| |
userdata = os.path.join(directory, "user-data")
|
| |
with open(userdata, 'w') as f:
|
| |
f.write(USER_DATA)
|
| |
+ if opts.sshd_usedns_no:
|
| |
+ f.write(BOOTCMD_SSHD_USEDNS_NO)
|
| |
# Create our cloud init so we can log in
|
| |
cloudinit = os.path.join(directory, "cloud-init.iso")
|
| |
subprocess.check_call(["/usr/bin/genisoimage", "-input-charset", "utf-8",
|
| |
@@ -654,6 +667,13 @@
|
| |
--use-basename, then you do not have to use --hostalias for every subject.
|
| |
"""
|
| |
|
| |
+
|
| |
+ def help_sshd_usedns_no():
|
| |
+ return """On some EL7 systems, sshd uses 'UseDNS yes' by default. This can
|
| |
+ create a very bad performance problem with ssh and Ansible. You can use
|
| |
+ --sshd-usedns-no to configure the VM to use 'UseDNS no' instead."""
|
| |
+
|
| |
+
|
| |
def main():
|
| |
global logger
|
| |
global diagnose
|
| |
@@ -683,6 +703,7 @@
|
| |
parser.add_argument('--host', help="Full path to qcow2 disk image")
|
| |
parser.add_argument("--use-basename", default=bool(distutils.util.strtobool(os.environ.get("TEST_USE_BASENAME", "False"))), action="store_true", help=help_hostalias())
|
| |
parser.add_argument("--hostalias", default=shlex.split(os.environ.get("TEST_HOSTALIASES", "")), action="append", help=help_hostalias())
|
| |
+ parser.add_argument("--sshd-usedns-no", default=bool(distutils.util.strtobool(os.environ.get("TEST_SSHD_USEDNS_NO", "False"))), action="store_true", help=help_sshd_usedns_no())
|
| |
parser.add_argument("subjects", nargs="*", default=shlex.split(os.environ.get("TEST_SUBJECTS", "")))
|
| |
opts = parser.parse_args()
|
| |
# Send logs to common logfile for all default provisioners.
|
| |
TEST_SSHD_USEDNS_NO
Some EL7 systems have
sshd
configured withUseDNS yes
by default. This willcause terrible performance with
ssh
and especially with Ansible. You can use--sshd-usedns-no
or setTEST_SSHD_USEDNS_NO=True
to configure the VM to useUseDNS no
instead.