align nodes order with tcpcloud templates, change root password
diff --git a/tcp_tests/settings.py b/tcp_tests/settings.py
index 4752d43..d0005a3 100644
--- a/tcp_tests/settings.py
+++ b/tcp_tests/settings.py
@@ -29,8 +29,8 @@
'TIMESTAT_PATH_YAML', os.path.join(
LOGS_DIR, 'timestat_{}.yaml'.format(time.strftime("%Y%m%d"))))
-SSH_LOGIN = os.environ.get('SSH_LOGIN', 'vagrant')
-SSH_PASSWORD = os.environ.get('SSH_PASSWORD', 'vagrant')
+SSH_LOGIN = os.environ.get('SSH_LOGIN', 'root')
+SSH_PASSWORD = os.environ.get('SSH_PASSWORD', 'r00tme')
SSH_NODE_CREDENTIALS = {"login": SSH_LOGIN,
"password": SSH_PASSWORD}
diff --git a/tcp_tests/templates/tcpcloud--user-data-master-node.yaml b/tcp_tests/templates/tcpcloud--user-data-master-node.yaml
index 891fdb0..6b0b1d1 100644
--- a/tcp_tests/templates/tcpcloud--user-data-master-node.yaml
+++ b/tcp_tests/templates/tcpcloud--user-data-master-node.yaml
@@ -3,20 +3,24 @@
ssh_pwauth: True
users:
- - name: vagrant
+ - name: root
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGwjUlYn9UsmWmAGSuEA2sICad7WqxgsJR0HKcMbbxi0tn96h4Cq2iGYmzlJ48egLm5R5pxyWnFvL4b/2zb+kKTPCMwRc9nv7xEGosEFNQEoSDd+gYu2CO0dgS2bX/7m2DXmzvhqPjxWQUXXsb0OYAS1r9Es65FE8y4rLaegz8V35xfH45bTCA0W8VSKh264XtGz12hacqsttE/UvyjJTZe+/XV+xJy3WAWxe8J/MuW1VqbqNewTmpTE/LJU8i6pG4msU6+wH99UvsGAOKQOduynUHKWG3VZg5YCjpbbV/t/pfW/vHB3b3jiifQmNhulyiG/CNnSQ5BahtV/7qPsYt vagrant@cfg01
+ disable_root: false
chpasswd:
list: |
- vagrant:vagrant
+ root:r00tme
expire: False
bootcmd:
# Block access to SSH while node is preparing
- cloud-init-per once sudo iptables -A INPUT -p tcp --dport 22 -j DROP
+ # Enable root access
+ - sed -i'.orig' -e's/without-password/yes/' /etc/ssh/sshd_config
+ - service sshd restart
output:
all: '| tee -a /var/log/cloud-init-output.log /dev/tty0'
@@ -25,9 +29,6 @@
- sudo echo "nameserver {gateway}" >> /etc/resolvconf/resolv.conf.d/base
- sudo resolvconf -u
- # Change owner for .ssh/
- - chown -R vagrant:vagrant /home/vagrant/.ssh
-
# Prepare network connection
- sudo ifup {interface_name}
- sudo route add default gw {gateway} {interface_name}
@@ -99,15 +100,15 @@
- service salt-minion restart
- echo "Showing system info and metadata ..."
- #- salt-call --no-color grains.items
- #- salt-call --no-color pillar.data
+ - salt-call --no-color grains.items
+ - salt-call --no-color pillar.data
- reclass -n {hostname}
- #- echo "Running complete state ..."
- #- salt-call --no-color state.sls linux openssh salt.minion
- #- salt-call --no-color state.sls salt.master
- #- service salt-minion restart
- #salt-call --no-color state.highstate
+ - echo "Running complete state ..."
+ - salt-call --no-color state.sls linux openssh salt.minion
+ - salt-call --no-color state.sls salt.master
+ - service salt-minion restart
+ # - salt-call --no-color state.highstate
########################################################
# Node is ready, allow SSH access
@@ -127,8 +128,8 @@
pre-up ifconfig $IFACE up
post-down ifconfig $IFACE down
- - path: /home/vagrant/.ssh/id_rsa
- owner: vagrant:vagrant
+ - path: /root/.ssh/id_rsa
+ owner: root:root
permissions: '0600'
content: |
-----BEGIN RSA PRIVATE KEY-----
@@ -159,8 +160,8 @@
XKI6Ldfq6TU3xKujRHfGP+oQ6GLwVCL/kjGxOuSRLFGfRiiqYI3nww==
-----END RSA PRIVATE KEY-----
- - path: /home/vagrant/.ssh/config
- owner: vagrant:vagrant
+ - path: /root/.ssh/config
+ owner: root:root
permissions: '0600'
content: |
Host *
diff --git a/tcp_tests/templates/tcpcloud--user-data.yaml b/tcp_tests/templates/tcpcloud--user-data.yaml
index abfa3ca..59eaf1e 100644
--- a/tcp_tests/templates/tcpcloud--user-data.yaml
+++ b/tcp_tests/templates/tcpcloud--user-data.yaml
@@ -3,20 +3,24 @@
ssh_pwauth: True
users:
- - name: vagrant
+ - name: root
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGwjUlYn9UsmWmAGSuEA2sICad7WqxgsJR0HKcMbbxi0tn96h4Cq2iGYmzlJ48egLm5R5pxyWnFvL4b/2zb+kKTPCMwRc9nv7xEGosEFNQEoSDd+gYu2CO0dgS2bX/7m2DXmzvhqPjxWQUXXsb0OYAS1r9Es65FE8y4rLaegz8V35xfH45bTCA0W8VSKh264XtGz12hacqsttE/UvyjJTZe+/XV+xJy3WAWxe8J/MuW1VqbqNewTmpTE/LJU8i6pG4msU6+wH99UvsGAOKQOduynUHKWG3VZg5YCjpbbV/t/pfW/vHB3b3jiifQmNhulyiG/CNnSQ5BahtV/7qPsYt vagrant@cfg01
+ disable_root: false
chpasswd:
list: |
- vagrant:vagrant
+ root:r00tme
expire: False
bootcmd:
# Block access to SSH while node is preparing
- cloud-init-per once sudo iptables -A INPUT -p tcp --dport 22 -j DROP
+ # Enable root access
+ - sed -i'.orig' -e's/without-password/yes/' /etc/ssh/sshd_config
+ - service sshd restart
output:
all: '| tee -a /var/log/cloud-init-output.log /dev/tty0'
diff --git a/tcp_tests/templates/tcpcloud-default.yaml b/tcp_tests/templates/tcpcloud-default.yaml
index 9231c5e..83ac27c 100644
--- a/tcp_tests/templates/tcpcloud-default.yaml
+++ b/tcp_tests/templates/tcpcloud-default.yaml
@@ -204,11 +204,11 @@
networks:
- private
- - name: cmp01.mk20-lab-advanced.local
+ - name: web01.mk20-lab-advanced.local
role: salt_minion
params:
- vcpu: !os_env SLAVE_NODE_CPU, 4
- memory: !os_env SLAVE_NODE_MEMORY, 8192
+ vcpu: !os_env SLAVE_NODE_CPU, 1
+ memory: !os_env SLAVE_NODE_MEMORY, 2048
boot:
- hd
cloud_init_volume_name: iso
@@ -242,11 +242,11 @@
networks:
- private
- - name: web01.mk20-lab-advanced.local
+ - name: cmp01.mk20-lab-advanced.local
role: salt_minion
params:
- vcpu: !os_env SLAVE_NODE_CPU, 1
- memory: !os_env SLAVE_NODE_MEMORY, 2048
+ vcpu: !os_env SLAVE_NODE_CPU, 4
+ memory: !os_env SLAVE_NODE_MEMORY, 8192
boot:
- hd
cloud_init_volume_name: iso