Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConsoleをGUIのUbuntuに変更 #66

Merged
merged 1 commit into from
Mar 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions console.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- inventories/host_vars/networks.yml

handlers:
- import_tasks: handlers/main.yml
- include: handlers/main.yml

tasks:
- name: Set Hostname
Expand All @@ -18,29 +18,28 @@
tags:
- network

- name: Set IP Address
community.general.nmcli:
conn_name: "{{ network.console.interface }}"
ip4: "{{ network.console.ipv4 }}/{{ network.subnet }}"
gw4: "{{ network.gw4 }}"
dns4: "{{ network.dns4 }}"
state: present
type: ethernet
tags:
- network

- include: tasks/authorized_keys.yml

- name: put motd
ansible.builtin.copy:
src: templates/etc/motd.console
src: templates/console/etc/motd
dest: /etc/motd
owner: root
group: root
mode: '0644'
tags:
- system

- name: put GUI session rc
ansible.builtin.copy:
src: templates/console/home/hayato/.xsessionrc
dest: /home/hayato/.xsessionrc
owner: hayato
group: hayato
mode: '0644'
tags:
- system

- name: Disable SELinux
ansible.builtin.copy:
src: templates/etc/selinux/config
Expand All @@ -51,9 +50,10 @@
tags:
- system

- name: Install Applications
ansible.builtin.apt:
name: "{{ apt }}"
state: present
tags:
- apt
- include: tasks/timezone.yml

- include: tasks/console/firewall.yml

- include: tasks/console/apt.yml

- include: tasks/stop-apt-daily.yml
8 changes: 0 additions & 8 deletions inventories/host_vars/console.yml

This file was deleted.

12 changes: 12 additions & 0 deletions tasks/console/apt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- name: Install Console modules
ansible.builtin.apt:
pkg:
- ffmpegthumbnailer
- gimp
- heif-thumbnailer
- libheif1
- openssh-server
- samba-common
- vlc
- wireshark
- xrdp
20 changes: 20 additions & 0 deletions tasks/console/firewall.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---

- name: Deny income policy
community.general.ufw:
state: enabled
policy: deny

- name: Allow SSH from service line
community.general.ufw:
rule: allow
proto: tcp
src: 192.168.1.0/24
port: '22'

- name: Allow RDP from service line
community.general.ufw:
rule: allow
proto: tcp
src: 192.168.1.0/24
port: '3389'
5 changes: 5 additions & 0 deletions templates/console/etc/motd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
_
___ ___ _ __ ___ ___ | | ___
/ __/ _ \| '_ \/ __|/ _ \| |/ _ \
| (_| (_) | | | \__ \ (_) | | __/
\___\___/|_| |_|___/\___/|_|\___|
3 changes: 3 additions & 0 deletions templates/console/home/hayato/.xsessionrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export GNOME_SHELL_SESSION_MODE=ubuntu
export XDG_CURRENT_DESKTOP=ubuntu:GNOME
export XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg