Add IBM donated s390x Z Linux instance to the CI pool
Since used a different username ended up parameterizing that as well.
diff --git a/README.md b/README.md
index 5c791c2..6c47299 100644
--- a/README.md
+++ b/README.md
@@ -84,6 +84,7 @@
instance_id = 123-abc...
[extra.<instancename>]
+ user = linux1
ip_addr = x.y.z.w
arch = s390x
num_cpus = 4
diff --git a/host_vars/couchdb01.yml b/host_vars/couchdb01.yml
deleted file mode 100644
index 665bae3..0000000
--- a/host_vars/couchdb01.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-jenkins_secret: !vault |
- $ANSIBLE_VAULT;1.1;AES256
- 39633766303861636339383165643366313930373761306165363863383139396463363830393335
- 3962396532656339613939383735643833313464363735340a396235323065623734393665363566
- 32343836336161623461366464666435363364656532643733626338613733303039313238646366
- 3335383937343563610a383465303933646364326339666363363335383730363865323166396433
- 62613163643036633931313263363435636662356565633665313332316562633339663230303861
- 65363834363265386462333134376134626231316462313933643133353031666630386537646662
- 39303334626363303261643139666331353962383961356432363331623965346466623366393730
- 63663234393531306235
-
diff --git a/host_vars/zlinux.yml b/host_vars/zlinux.yml
new file mode 100644
index 0000000..f04fa6f
--- /dev/null
+++ b/host_vars/zlinux.yml
@@ -0,0 +1,11 @@
+jenkins_secret: !vault |
+ $ANSIBLE_VAULT;1.1;AES256
+ 32643762626165613832643734333964393439343466393132626161613030393939343662396130
+ 3038623866326136306533393131303230326236323861610a623035613166633634376336383532
+ 33306338396162616330323161633330373961393665626662653365386534353030616464353464
+ 6363366465363630650a623538363033663862613138333863663763616266613162366165346664
+ 37353531646232613264326135313161396237363563376566386466326337306233386365623663
+ 64363964373933343738376133636331343734646565346332323238383437643365653531346165
+ 33323461303434356331373132653833613137653163393339633361616435363161363432356138
+ 38663266353833316566
+
diff --git a/production b/production
index e1e3d6a..76ebddb 100644
--- a/production
+++ b/production
@@ -18,6 +18,7 @@
arch: amd64
num_cpus: 2
ram: 4
+ user: root
ci_agents:
hosts:
couchdb-worker-x86-64-debian-dal-1-01:
@@ -38,6 +39,7 @@
arch: amd64
num_cpus: 4
ram: 8
+ user: root
couchdb-worker-x86-64-debian-dal-1-02:
instance:
created_at: '2020-12-04T17:37:20Z'
@@ -56,6 +58,7 @@
arch: amd64
num_cpus: 4
ram: 8
+ user: root
couchdb-worker-x86-64-debian-dal-1-03:
instance:
created_at: '2020-12-04T17:36:58Z'
@@ -74,6 +77,7 @@
arch: amd64
num_cpus: 4
ram: 8
+ user: root
couchdb-worker-x86-64-debian-dal-1-04:
instance:
created_at: '2020-12-04T17:36:37Z'
@@ -92,6 +96,7 @@
arch: amd64
num_cpus: 4
ram: 8
+ user: root
couchdb-worker-x86-64-debian-dal-1-05:
instance:
created_at: '2020-12-04T17:24:05Z'
@@ -110,6 +115,7 @@
arch: amd64
num_cpus: 4
ram: 8
+ user: root
couchdb-worker-x86-64-debian-dal-1-06:
instance:
created_at: '2020-12-04T17:23:32Z'
@@ -128,6 +134,7 @@
arch: amd64
num_cpus: 4
ram: 8
+ user: root
couchdb-worker-x86-64-debian-dal-1-07:
instance:
created_at: '2020-12-04T17:22:57Z'
@@ -146,6 +153,7 @@
arch: amd64
num_cpus: 4
ram: 8
+ user: root
couchdb-worker-x86-64-debian-dal-1-08:
instance:
created_at: '2021-03-08T21:13:51Z'
@@ -164,6 +172,7 @@
arch: amd64
num_cpus: 4
ram: 8
+ user: root
ubuntu:
instance:
id: ubuntu
@@ -177,3 +186,18 @@
arch: ppc64le
num_cpus: 8
ram: 16
+ user: ubuntu
+ zlinux:
+ instance:
+ id: zlinux
+ name: zlinux
+ subnet: null
+ ip_addrs:
+ bastion_host: null
+ bastion_ip: null
+ public: 148.100.85.51
+ system:
+ arch: s390x
+ num_cpus: 8
+ ram: 16
+ user: linux1
diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml
index 34b25d8..d1d774c 100644
--- a/roles/common/tasks/main.yml
+++ b/roles/common/tasks/main.yml
@@ -1,6 +1,6 @@
-- name: Allow CouchDB Infra access on Ubuntu
+- name: Allow CouchDB Infra access
authorized_key:
- user: ubuntu
+ user: "{{ ansible_user_id }}"
state: present
key: "{{ item }}"
with_items:
@@ -8,19 +8,6 @@
- https://github.com/kocolosk.keys
- https://github.com/nickva.keys
- https://github.com/wohali.keys
- when: ansible_distribution == "Ubuntu"
-
-- name: Allow CouchDB Infra access on Debian
- authorized_key:
- user: root
- state: present
- key: "{{ item }}"
- with_items:
- - https://github.com/davisp.keys
- - https://github.com/kocolosk.keys
- - https://github.com/nickva.keys
- - https://github.com/wohali.keys
- when: ansible_distribution == "Debian"
- name: Lock root account
become: yes
diff --git a/ssh.cfg b/ssh.cfg
index 0ba95bb..20dddcf 100644
--- a/ssh.cfg
+++ b/ssh.cfg
@@ -64,3 +64,12 @@
ControlPath /tmp/ansible-%r@%h:%p
ControlPersist 30m
+Host zlinux
+ Hostname 148.100.85.51
+ User linux1
+ ForwardAgent yes
+ StrictHostKeyChecking no
+ ControlMaster auto
+ ControlPath /tmp/ansible-%r@%h:%p
+ ControlPersist 30m
+
diff --git a/tools/gen-config b/tools/gen-config
index a47c44d..0d15447 100755
--- a/tools/gen-config
+++ b/tools/gen-config
@@ -52,6 +52,7 @@
"name" : name,
"instance_id" : parser.get(section, "id", fallback=name),
"ip_addr": parser.get(section, "ip_addr"),
+ "user": parser.get(section, "user"),
"system": {
"arch": parser.get(section, "arch"),
"num_cpus": int(parser.get(section, "num_cpus")),
@@ -184,7 +185,8 @@
"arch": instance["vcpu"]["architecture"],
"num_cpus": instance["vcpu"]["count"],
"ram": instance["memory"]
- }
+ },
+ "user": "root"
}
@@ -218,7 +220,8 @@
"arch": instance["vcpu"]["architecture"],
"num_cpus": instance["vcpu"]["count"],
"ram": instance["memory"]
- }
+ },
+ "user": "root"
}
def load_s390x_ci_agent(ci_agents, instance):
@@ -226,7 +229,6 @@
if name in ci_agents:
print(f"Duplicate ci_agent found {name}")
exit(2)
-
ci_agents[name] = {
"instance": {
"id": instance["instance_id"],
@@ -238,7 +240,8 @@
"bastion_host": None,
"public": instance["ip_addr"]
},
- "system": instance["system"]
+ "system": instance["system"],
+ "user": instance["user"]
}
def load_ppc64le_ci_agent(ci_agents, instance):
@@ -258,7 +261,8 @@
"bastion_host": None,
"public": instance["ip_addr"]
},
- "system": instance["system"]
+ "system": instance["system"],
+ "user": instance["user"]
}
def get_private_ip(instance):
@@ -330,17 +334,18 @@
with open(filename, "w") as handle:
for host, info in sorted(bastions.items()):
args = {
- "user": "root",
+ "user": info["user"],
"host": host,
"ip_addr": info["ip_addrs"]["public"]
}
entry = bastion_tmpl.format(**args)
handle.write(entry)
for host, info in sorted(ci_agents.items()):
+ user = info["user"]
if info["system"]["arch"] in ["ppc64le", "s390x"]:
# Power or s390x use an external IP directly
args = {
- "user": "ubuntu",
+ "user": user,
"host": host,
"ip_addr": info["ip_addrs"]["public"]
}
@@ -349,7 +354,7 @@
bastion_ip = info["ip_addrs"]["bastion_ip"]
bastion_host = info["ip_addrs"]["bastion_host"]
args = {
- "user": "root",
+ "user": user,
"host": host,
"ip_addr": info["ip_addrs"]["private"],
"bastion_ip": bastion_ip,