commit f02288523b778cabfcdafef9fa7103d4ac5c799f Author: pgrondek Date: Wed Jul 1 13:45:11 2020 +0200 Import into git diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..723ef36 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..36df4eb --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,2 @@ +[privilege_escalation] +become_ask_pass=True diff --git a/localhost.yml b/localhost.yml new file mode 100644 index 0000000..d5e128e --- /dev/null +++ b/localhost.yml @@ -0,0 +1,6 @@ +--- +- hosts: localhost + roles: + - dwm + - ubuntu + - docker diff --git a/roles/docker/tasks/install-docker-io.yml b/roles/docker/tasks/install-docker-io.yml new file mode 100644 index 0000000..ef51958 --- /dev/null +++ b/roles/docker/tasks/install-docker-io.yml @@ -0,0 +1,7 @@ +--- +- name: install needed packages + become: yes + apt: + update_cache: yes + pkg: + - docker.io diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml new file mode 100644 index 0000000..7eddbd9 --- /dev/null +++ b/roles/docker/tasks/main.yml @@ -0,0 +1,4 @@ +--- +- import_tasks: install-docker-io.yml + when: ansible_distribution == "Ubuntu" and ansible_distribution_version != "18.04" + diff --git a/roles/dwm/files/usr/share/icons/dwm.png b/roles/dwm/files/usr/share/icons/dwm.png new file mode 100644 index 0000000..21603d2 Binary files /dev/null and b/roles/dwm/files/usr/share/icons/dwm.png differ diff --git a/roles/dwm/files/usr/share/xsessions/dwm.desktop b/roles/dwm/files/usr/share/xsessions/dwm.desktop new file mode 100644 index 0000000..b0c3354 --- /dev/null +++ b/roles/dwm/files/usr/share/xsessions/dwm.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=Dwm +Comment=Dynamic window manager +Exec=dwm +Icon=dwm +Type=XSession diff --git a/roles/dwm/tasks/dwm.yml b/roles/dwm/tasks/dwm.yml new file mode 100644 index 0000000..8509f0a --- /dev/null +++ b/roles/dwm/tasks/dwm.yml @@ -0,0 +1,41 @@ +--- +- name: install required packages + apt: + update_cache: yes + pkg: + - git + - make + - libx11-dev + - libxft-dev + - libxinerama-dev + - libxcb-res0-dev + - libx11-xcb-dev + +- name: checkout + shell: + cmd: | + mkdir -p ~/src + cd ~/src + git clone {{ dwm-repo }} + +- name: build dwm + make: + chdir: ~/src/dwm + +- name: copy xsession + become: yes + copy: + src: usr/share/xsessions/dwm.desktop + dest: /usr/share/xsessions/dwm.desktop + +- name: copy icon + become: yes + copy: + src: usr/share/icons/dwm.png + dest: /usr/share/icons/dwm.png + +- name: install dwm + become: yes + make: + chdir: ~/src/dwm + target: install diff --git a/roles/dwm/tasks/main.yml b/roles/dwm/tasks/main.yml new file mode 100644 index 0000000..ad57c3e --- /dev/null +++ b/roles/dwm/tasks/main.yml @@ -0,0 +1,4 @@ +--- +- import_tasks: setup.yml + +- import_tasks: dwm.yml diff --git a/roles/dwm/tasks/setup.yml b/roles/dwm/tasks/setup.yml new file mode 100644 index 0000000..5376553 --- /dev/null +++ b/roles/dwm/tasks/setup.yml @@ -0,0 +1,9 @@ +--- +- block: + become: yes + - name: install git and make + apt: + update_cache: yes + pkg: + - git + - make diff --git a/roles/dwm/vars/main.yml b/roles/dwm/vars/main.yml new file mode 100644 index 0000000..093d896 --- /dev/null +++ b/roles/dwm/vars/main.yml @@ -0,0 +1,3 @@ +--- +dwm-repo: https://github.com/pgrondek/dwm.git +st-repo: https://github.com/pgrondek/stterm.git diff --git a/roles/ubuntu/files/etc/default/motd-news b/roles/ubuntu/files/etc/default/motd-news new file mode 100644 index 0000000..eefe29c --- /dev/null +++ b/roles/ubuntu/files/etc/default/motd-news @@ -0,0 +1,19 @@ +# Enable/disable the dynamic MOTD news service +# This is a useful way to provide dynamic, informative +# information pertinent to the users and administrators +# of the local system +ENABLED=0 + +# Configure the source of dynamic MOTD news +# White space separated list of 0 to many news services +# For security reasons, these must be https +# and have a valid certificate +# Canonical runs a service at motd.ubuntu.com, and you +# can easily run one too +URLS="https://motd.ubuntu.com" + +# Specify the time in seconds, you're willing to wait for +# dynamic MOTD news +# Note that news messages are fetched in the background by +# a systemd timer, so this should never block boot or login +WAIT=5 diff --git a/roles/ubuntu/tasks/cleanup.yml b/roles/ubuntu/tasks/cleanup.yml new file mode 100644 index 0000000..9dfa594 --- /dev/null +++ b/roles/ubuntu/tasks/cleanup.yml @@ -0,0 +1,16 @@ +--- +- become: yes + block: + - name: clean packages + apt: + pkg: + - snapd + - cloud-init + - lxd + - lxd-client + state: absent + + - name: disable ubuntu ads + copy: + src: etc/default/motd-news + dest: /etc/default/motd-news diff --git a/roles/ubuntu/tasks/main.yml b/roles/ubuntu/tasks/main.yml new file mode 100644 index 0000000..e4e4550 --- /dev/null +++ b/roles/ubuntu/tasks/main.yml @@ -0,0 +1,4 @@ +--- +- import_tasks: cleanup.yml + +- import_tasks: timezone.yml diff --git a/roles/ubuntu/tasks/timezone.yml b/roles/ubuntu/tasks/timezone.yml new file mode 100644 index 0000000..43dc9da --- /dev/null +++ b/roles/ubuntu/tasks/timezone.yml @@ -0,0 +1,6 @@ +--- +- name: set timezone + become: yes + shell: + cmd: | + timedatectl set-timezone {{ timezone }} diff --git a/roles/ubuntu/vars/main.yml b/roles/ubuntu/vars/main.yml new file mode 100644 index 0000000..1cf7e81 --- /dev/null +++ b/roles/ubuntu/vars/main.yml @@ -0,0 +1,2 @@ +--- +timezone: Europe/Warsaw