diff --git a/console.yml b/console.yml index 67a481b..45a8646 100644 --- a/console.yml +++ b/console.yml @@ -9,7 +9,7 @@ - inventories/host_vars/networks.yml handlers: - - import_tasks: handlers/main.yml + - include: handlers/main.yml tasks: - name: Set Hostname @@ -18,22 +18,11 @@ 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 @@ -41,6 +30,16 @@ 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 @@ -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 diff --git a/inventories/host_vars/console.yml b/inventories/host_vars/console.yml deleted file mode 100644 index bebdb88..0000000 --- a/inventories/host_vars/console.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- - -apt: - - network-manager - - libnm-dev - - curl - - git - - zsh diff --git a/tasks/console/apt.yml b/tasks/console/apt.yml new file mode 100644 index 0000000..0703e48 --- /dev/null +++ b/tasks/console/apt.yml @@ -0,0 +1,12 @@ +- name: Install Console modules + ansible.builtin.apt: + pkg: + - ffmpegthumbnailer + - gimp + - heif-thumbnailer + - libheif1 + - openssh-server + - samba-common + - vlc + - wireshark + - xrdp diff --git a/tasks/console/firewall.yml b/tasks/console/firewall.yml new file mode 100644 index 0000000..f4b53c6 --- /dev/null +++ b/tasks/console/firewall.yml @@ -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' diff --git a/templates/console/etc/motd b/templates/console/etc/motd new file mode 100644 index 0000000..8897ed6 --- /dev/null +++ b/templates/console/etc/motd @@ -0,0 +1,5 @@ + _ + ___ ___ _ __ ___ ___ | | ___ + / __/ _ \| '_ \/ __|/ _ \| |/ _ \ +| (_| (_) | | | \__ \ (_) | | __/ + \___\___/|_| |_|___/\___/|_|\___| diff --git a/templates/console/home/hayato/.xsessionrc b/templates/console/home/hayato/.xsessionrc new file mode 100644 index 0000000..ff990ed --- /dev/null +++ b/templates/console/home/hayato/.xsessionrc @@ -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