Skip to content

Commit

Permalink
Merge pull request #66 from cradle8810/console_rebuild_20240303
Browse files Browse the repository at this point in the history
ConsoleをGUIのUbuntuに変更
  • Loading branch information
cradle8810 authored Mar 3, 2024
2 parents b6caaeb + 399d33a commit bf6bdb7
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 27 deletions.
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

0 comments on commit bf6bdb7

Please sign in to comment.