Skip to content

Commit

Permalink
summarize flags
Browse files Browse the repository at this point in the history
  • Loading branch information
e-carlin committed Jan 16, 2024
1 parent 1448824 commit 7f94b89
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
7 changes: 1 addition & 6 deletions rsconf/component/vm_devbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
from rsconf import component
from rsconf import systemd

_VM_DIR = "v"


class T(component.T):
def internal_build_compile(self):
Expand All @@ -34,7 +32,6 @@ def _create_user_instances():
systemd.unit_prepare(self, self.j2_ctx)
z.run_d = systemd.unit_run_d(jc, self.name)
z.run_u = jc.rsconf_db.run_u
z.vm_d = z.run_d.join(_VM_DIR)
z.ssh_port = jc.base_users.spec[self._user].vm_devbox_ssh_port
z.ssh_guest_host_key_f = "/etc/ssh/host_key"
z.ssh_guest_identity_pub_f = "/etc/ssh/identity.pub"
Expand All @@ -48,8 +45,6 @@ def internal_build_write(self):
return
jc = self.j2_ctx
z = jc[self.name]
self.install_access(mode="700", owner=z.run_u)
self.install_directory(z.vm_d)
self.install_access(mode="500", owner=z.run_u)
self.install_resource("vm_devbox/start.sh", host_path=z.start_f)
self.install_access(mode="444", owner=jc.rsconf_db.root_u)
Expand All @@ -61,7 +56,7 @@ def _network(self, jc, z):
self.buildt.get_component("network").add_public_tcp_ports([str(z.ssh_port)])

def _ssh(self, jc, z):
z.sshd_config_f = z.vm_d.join("sshd_config")
z.sshd_config_f = z.run_d.join("sshd_config")
s = self.gen_identity_and_host_ssh_keys(jc, "host", encrypt_identity=True)
z.pkupdate(
PKDict(
Expand Down
9 changes: 2 additions & 7 deletions rsconf/package_data/vm_devbox/start.sh.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ vm_devbox_first_start() {
if [[ -e Vagrantfile ]]; then
return
fi
curl '{{ rsconf_db.installers_url }}' | vagrant_dev_private_net= \
vagrant_dev_provision_eth1= \
vagrant_dev_no_mounts=1 \
vagrant_dev_no_nfs_src=1 \
vagrant_dev_no_vbguest=1 \
bash -s vagrant-sirepo-dev
curl '{{ rsconf_db.installers_url }}' | vagrant_dev_vm_devbox=1 bash -s vagrant-sirepo-dev
}

vm_devbox_set_forwarded_port() {
Expand Down Expand Up @@ -64,7 +59,7 @@ EOF_BASH
EOF
}

cd {{ this.vm_d }}
cd {{ this.run_d }}
vm_devbox_create_vm
vm_devbox_set_forwarded_port
vm_devbox_set_ssh_config
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ EOF_BASH
EOF
}

cd /srv/vm_devbox_joeblow/v
cd /srv/vm_devbox_joeblow
vm_devbox_create_vm
vm_devbox_set_forwarded_port
vm_devbox_set_ssh_config
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#!/bin/bash
vm_devbox_joeblow_rsconf_component() {
rsconf_service_prepare 'vm_devbox_joeblow' '/etc/systemd/system/vm_devbox_joeblow.service' '/etc/systemd/system/vm_devbox_joeblow.service.d'
rsconf_install_access '700' 'vagrant' 'vagrant'
rsconf_install_directory '/srv/vm_devbox_joeblow/v'
rsconf_install_access '500' 'vagrant' 'vagrant'
rsconf_install_file '/srv/vm_devbox_joeblow/start' '839c6fd2c437d24d4cae44dcd243db26'
rsconf_install_file '/srv/vm_devbox_joeblow/start' '711efae568b1987bbb01c4fd84021914'
rsconf_install_access '444' 'root' 'root'
rsconf_install_file '/etc/systemd/system/vm_devbox_joeblow.service' '0281d04b4abaec88ab85a6751aa3587f'
}

0 comments on commit 7f94b89

Please sign in to comment.