forked from QubesOS/qubes-mgmt-salt
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend qubesctl to configure also VMs
This commit uses salt-ssh (running over qrexec) called from "DispVM" to configure VMs. For that to work, DispVM gets copy of Salt configuration (mostly full configuration - the only exception is pillars, filtered at dom0 side). Fixes QubesOS/qubes-issues#1541
- Loading branch information
Showing
9 changed files
with
505 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# The Qubes OS Project, https://www.qubes-os.org/ | ||
# | ||
# Copyright (C) 2016 Marek Marczykowski-Górecki | ||
# <[email protected]> | ||
# | ||
# q program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License along | ||
# with this program; if not, write to the Free Software Foundation, Inc., | ||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
|
||
set -e | ||
|
||
if [ "`id -u`" -ne 0 ]; then | ||
exec sudo "$0" "$@" | ||
fi | ||
|
||
read target_vm | ||
read salt_command | ||
|
||
rm -rf /srv | ||
mv /home/user/QubesIncoming/dom0/srv /srv | ||
if [ -f /srv/master ]; then | ||
mv /srv/master /etc/salt/ | ||
fi | ||
(cd /srv/salt; find _tops -type f -o -type l| sed -e 's/^/- /' > tops.yaml) | ||
cat > /etc/salt/roster <<EOF | ||
$target_vm: | ||
host: $target_vm | ||
EOF | ||
export PATH="/usr/lib/qubes-vm-connector/ssh-wrapper:$PATH" | ||
salt-ssh "$target_vm" $salt_command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.