commit c60fdd8ff68868a4dc03e620fb7f5188b454b451 Author: Rosario-Francesco Polito Date: Tue Jan 18 15:34:59 2022 +0100 init with basic installation / preperation diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..eecbc51 --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,5 @@ +[defaults] +INVENTORY = hosts + +[ssh_connections] +pipelining = true \ No newline at end of file diff --git a/group_vars/all/vars.yml b/group_vars/all/vars.yml new file mode 100644 index 0000000..912c1e7 --- /dev/null +++ b/group_vars/all/vars.yml @@ -0,0 +1 @@ +username: YOUR_USERNAME \ No newline at end of file diff --git a/hosts b/hosts new file mode 100644 index 0000000..5bbbfa5 --- /dev/null +++ b/hosts @@ -0,0 +1,2 @@ +[home] +swserver ansible_host=192.168.0.29 ansible_user=YOUR_USERNAME ansible_connection=ssh ansible_ssh_private_key_file=PATH_TO_KEY \ No newline at end of file diff --git a/run.yml b/run.yml new file mode 100644 index 0000000..2cc8aa9 --- /dev/null +++ b/run.yml @@ -0,0 +1,6 @@ +--- +- hosts: all + become: yes + + tasks: + - import_tasks: tasks/essential.yml \ No newline at end of file diff --git a/tasks/essential.yml b/tasks/essential.yml new file mode 100644 index 0000000..c83e13b --- /dev/null +++ b/tasks/essential.yml @@ -0,0 +1,50 @@ +- name: Update packages + apt: + update_cache: yes + upgrade: yes + +- name: Install essentials + package: + name: + - nano + - curl + - telnet + - wget + - htop + - sshguard + state: latest + +# maybe disable passwordless sudo later + +- name: Enable passwordless sudo for "{{username}}" + lineinfile: + dest: /etc/sudoers + regexp: "^%wheel" + line: "{{username}} ALL=(ALL) NOPASSWD: ALL" + validate: "/usr/sbin/visudo -cf %s" + +- name: Install aptitute + apt: name=aptitude state=latest update_cache=yes force_apt_get=yes + +- name: Install required system packages + apt: name={{ item }} state=latest update_cache=yes + loop: [ 'apt-transport-https', 'ca-certificates', 'curl', 'software-properties-common', 'python3-pip', 'virtualenv', 'python3-setuptools'] + +- name: Shopware Dependencies + package: + name: + - unzip + - nginx + - php7.4-fpm + - php7.4-mysql + - php7.4-json + - php7.4-curl + - php7.4-gd + - php7.4-xml + - php7.4-zip + - php7.4-opcache + - php7.4-mbstring + - php7.4-intl + - php7.4-cli + - mariadb-server + state: latest \ No newline at end of file