Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22422331
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/tasks/main.yml b/tasks/main.yml
index 38e2a00..568a8af 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -1,104 +1,109 @@
---
- name: "set facts"
set_fact:
zsh_autosuggestions_install_dir: "/usr/lib/zsh-autosuggestions"
- name: ensure apt cache is up to date
ansible.builtin.apt:
update_cache: true
when: ansible_facts['os_family'] == 'Debian'
- name: create ansible user
ansible.builtin.user:
name: ansible
shell: /bin/bash
groups: sudo
create_home: true
state: present
uid: 1000
- name: Install required system packages
apt:
name:
- emacs-nox
- tmux
- curl
- git
- ufw
- iotop
- htop
- ncdu
- nethogs
- silversearcher-ag
- strace
- fail2ban
- zsh
- zsh-syntax-highlighting
state: latest
update_cache: true
- name: set root shell to zsh
ansible.builtin.user:
name: root
shell: /usr/bin/zsh
- name: "clone zsh-autosuggestions"
git:
repo: "https://github.com/zsh-users/zsh-autosuggestions"
dest: "{{ zsh_autosuggestions_install_dir }}"
version: "85919cd"
- name: zshrc
template:
src: "zshrc.j2"
dest: "/root/.zshrc"
- name: journald settings
template:
src: "journald.conf"
dest: "/etc/systemd/journald.conf"
register: journald_settings
- name: Restart systemd-journald to apply config changes
ansible.builtin.systemd:
name: systemd-journald
state: restarted
when: journald_settings.changed
- name: Allow SSH through ufw
community.general.ufw:
rule: allow
name: OpenSSH
- name: Allow all traffic from localhost to localhost
ansible.builtin.ufw:
rule: allow
from_ip: 127.0.0.1
to_ip: 127.0.0.1
- name: Enable ufw
community.general.ufw:
state: enabled
policy: deny
- name: Disable password login in ssh
lineinfile:
path: /etc/ssh/sshd_config
state: present
line: "PasswordAuthentication no"
- name: Reload sshd
ansible.builtin.service:
name: ssh.service
state: reloaded
- name: Copy fail2ban config for ssh
template:
src: "fail2ban-jail.local.j2"
dest: "/etc/fail2ban/jail.local"
- name: Reload fail2ban
service:
name: fail2ban
state: reloaded
enabled: true
+
+- name: "Emacs config"
+ template:
+ src: "emacs.init.el"
+ dest: "/root/.emacs.d/init.el"
diff --git a/templates/emacs.init.el b/templates/emacs.init.el
new file mode 100644
index 0000000..a686fbb
--- /dev/null
+++ b/templates/emacs.init.el
@@ -0,0 +1 @@
+(delete-selection-mode 1)
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Nov 28, 03:20 (1 d, 13 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1230176
Default Alt Text
(2 KB)
Attached To
Mode
rACMN ansible-common
Attached
Detach File
Event Timeline