ソースを参照

vnc socket workspaces

pull/1/head
コミット
f39decabf9
4個のファイルの変更34行の追加17行の削除
  1. +11
    -11
      tasks/vnc.yaml
  2. +4
    -1
      tasks/workspaces.yaml
  3. +1
    -1
      templates/workspaces/workspace.focus.fish.j2
  4. +18
    -4
      templates/workspaces/workspace.space.fish.j2

+ 11
- 11
tasks/vnc.yaml ファイルの表示

@@ -13,17 +13,17 @@
mode: 0600
force: no

- name: fetch vnc passwd
fetch:
src: ~/.vnc/passwd
dest: ~/.vnc/passwd.{{inventory_hostname}}
flat: yes
- name: copy vnc passwd files
copy:
src: ~/.vnc/passwd.{{item}}
dest: ~/.vnc/passwd.{{item}}
with_items: "{{ home_access_to_hosts }}"
# - name: fetch vnc passwd
# fetch:
# src: ~/.vnc/passwd
# dest: ~/.vnc/passwd.{{inventory_hostname}}
# flat: yes
#
# - name: copy vnc passwd files
# copy:
# src: ~/.vnc/passwd.{{item}}
# dest: ~/.vnc/passwd.{{item}}
# with_items: "{{ home_access_to_hosts }}"

- name: default vnc client options
template:


+ 4
- 1
tasks/workspaces.yaml ファイルの表示

@@ -26,6 +26,9 @@
src: workspaces/workspace.space.fish.j2
dest: ~/.workspaces/{{workspace}}.space
mode: 0755
with_items: "{{workspaces|dict2items|json_query(\"[?value.type=='vncviewer'||value.type=='tmux'].key\") }}"
with_items: "{{ workspaces }}"
loop_control:
loop_var: workspace
when:
- workspaces[workspace]
- '"type" in workspaces[workspace]'

+ 1
- 1
templates/workspaces/workspace.focus.fish.j2 ファイルの表示

@@ -2,7 +2,7 @@
{{ ansible_managed | comment }}

{% if workspaces[workspace].type is defined %}
{% if workspaces[workspace].type == "vncviewer" %}
{% if "vncviewer" in workspaces[workspace].type %}
i3-msg mode remote
{% endif %}
{% endif %}


+ 18
- 4
templates/workspaces/workspace.space.fish.j2 ファイルの表示

@@ -1,12 +1,26 @@
#!/usr/bin/fish
{{ ansible_managed | comment }}

{% if workspaces[workspace].type == "vncviewer" %}
{% if workspaces[workspace].type == "tmux" %}

xtigervncviewer localhost:{{workspaces[workspace].display|default(home_vncserver_display_number)}} -via {{workspaces[workspace].host}} -PasswordFile ~/.vnc/passwd.{{workspaces[workspace].host}}
exec urxvt -title tmux-workspace -e fish -c 'ssh -t {{workspaces[workspace].host}} tmux attach -d -t {{workspaces[workspace].session}}'

{% elif workspaces[workspace].type == "tmux" %}
{% elif "vncviewer" in workspaces[workspace].type %}

urxvt -title tmux-workspace -e fish -c 'ssh -t {{workspaces[workspace].host}} tmux attach -d -t {{workspaces[workspace].session}}'
{% if workspaces[workspace].fetch_vnc_passsword_file | default(true) %}
if not test -d ~/.vnc/passwd.{{workspaces[workspace].host}}
rsync {{workspaces[workspace].host}}:~/.vnc/passwd ~/.vnc/passwd.{{workspaces[workspace].host}}
end
{% endif %}

{% if workspaces[workspace].type == "vncviewer-ssh-socket" %}

socat "UNIX-LISTEN:.vnc/socket.anix,reuseaddr" EXEC:'ssh {{workspaces[workspace].host}} socat STDIO UNIX-CONNECT\:.vnc/socket' &
exec xtigervncviewer .vnc/socket.{{workspaces[workspace].host}} -PasswordFile ~/.vnc/passwd.{{workspaces[workspace].host}}

{% elif workspaces[workspace].type == "vncviewer-ssh-tcp" %}

exec xtigervncviewer localhost:{{workspaces[workspace].display|default(home_vncserver_display_number)}} -via {{workspaces[workspace].host}} -PasswordFile ~/.vnc/passwd.{{workspaces[workspace].host}}

{% endif %}
{% endif %}