From f4ee05f46e2cbe1865ad42dd765e271439aced42 Mon Sep 17 00:00:00 2001 From: Niklas Yann Wettengel Date: Fri, 17 Mar 2017 19:12:21 +0100 Subject: added setup_fastd.yml playbook current features: - install yaourt - install packages for admins --- .gitignore | 4 +++- .gitmodules | 3 +++ inventory.ini.sample | 12 ++++++++++++ library/aur | 1 + library/external_modules/ansible-aur | 1 + new_inventory.ini.sample | 8 -------- roles/install_admin_packages/tasks/main.yml | 13 +++++++++++++ roles/install_yaourt/files/10-wheel | 1 + roles/install_yaourt/tasks/main.yml | 27 +++++++++++++++++++++++++++ setup_fastd.yml | 7 +++++++ 10 files changed, 68 insertions(+), 9 deletions(-) create mode 100644 .gitmodules create mode 100644 inventory.ini.sample create mode 120000 library/aur create mode 160000 library/external_modules/ansible-aur delete mode 100644 new_inventory.ini.sample create mode 100644 roles/install_admin_packages/tasks/main.yml create mode 100644 roles/install_yaourt/files/10-wheel create mode 100644 roles/install_yaourt/tasks/main.yml create mode 100644 setup_fastd.yml diff --git a/.gitignore b/.gitignore index 37dfe53..27a9230 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -new_inventory.ini +inventory.ini + +*.swp diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..d14a41e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "library/external_modules/ansible-aur"] + path = library/external_modules/ansible-aur + url = git://github.com/cdown/ansible-aur.git diff --git a/inventory.ini.sample b/inventory.ini.sample new file mode 100644 index 0000000..54dc92e --- /dev/null +++ b/inventory.ini.sample @@ -0,0 +1,12 @@ +[new_fastds] +123.123.123.123 arch_hostname=fastd1 + +[fastds] +123.123.123.123 + +[all:vars] +hetzner_webservice_username= +hetzner_webservice_password= +rescue_authorized_key= +authorized_keys=["", ""] +aur_user=yaourt diff --git a/library/aur b/library/aur new file mode 120000 index 0000000..ac7f09a --- /dev/null +++ b/library/aur @@ -0,0 +1 @@ +external_modules/ansible-aur/aur \ No newline at end of file diff --git a/library/external_modules/ansible-aur b/library/external_modules/ansible-aur new file mode 160000 index 0000000..04eec3e --- /dev/null +++ b/library/external_modules/ansible-aur @@ -0,0 +1 @@ +Subproject commit 04eec3e0afdf31d09ffa79067b75e6b05c78fd61 diff --git a/new_inventory.ini.sample b/new_inventory.ini.sample deleted file mode 100644 index 792ee30..0000000 --- a/new_inventory.ini.sample +++ /dev/null @@ -1,8 +0,0 @@ -[new_fastds] -123.123.123.123 arch_hostname=fastd1 - -[all:vars] -hetzner_webservice_username= -hetzner_webservice_password= -rescue_authorized_key= -authorized_keys=["", ""] diff --git a/roles/install_admin_packages/tasks/main.yml b/roles/install_admin_packages/tasks/main.yml new file mode 100644 index 0000000..d3d920a --- /dev/null +++ b/roles/install_admin_packages/tasks/main.yml @@ -0,0 +1,13 @@ +--- +- name: update pacman cache + pacman: + update_cache: yes +- name: install packages for admins + pacman: + name: '{{ item }}' + state: present + with_items: + - rxvt-unicode-terminfo + - bash-completion + - vim + - htop diff --git a/roles/install_yaourt/files/10-wheel b/roles/install_yaourt/files/10-wheel new file mode 100644 index 0000000..7c499c2 --- /dev/null +++ b/roles/install_yaourt/files/10-wheel @@ -0,0 +1 @@ +%wheel ALL=(ALL) NOPASSWD: ALL diff --git a/roles/install_yaourt/tasks/main.yml b/roles/install_yaourt/tasks/main.yml new file mode 100644 index 0000000..4ddbcd5 --- /dev/null +++ b/roles/install_yaourt/tasks/main.yml @@ -0,0 +1,27 @@ +--- +- name: add aur user {{ aur_user }} + user: + name: '{{ aur_user }}' + group: users + groups: wheel + +- name: allow group wheel to sudo + copy: + src: 10-wheel + dest: /etc/sudoers.d/ + +- name: "add archlinux.fr repository to pacman" + lineinfile: + dest: "/etc/pacman.conf" + state: "present" + line: "{{ item }}" + with_items: + - "[archlinuxfr]" + - "SigLevel = Never" + - "Server = http://repo.archlinux.fr/$arch" + +- name: "install yaourt" + pacman: + update_cache: yes + name: "yaourt" + state: "present" diff --git a/setup_fastd.yml b/setup_fastd.yml new file mode 100644 index 0000000..238b257 --- /dev/null +++ b/setup_fastd.yml @@ -0,0 +1,7 @@ +--- +- name: setup fastds + hosts: fastds + user: root + roles: + - install_yaourt + - install_admin_packages -- cgit v1.2.3-54-g00ecf