diff --git a/tp-cloud/ansible/gcp_compute.yml b/tp-cloud/ansible/gcp_compute.yml index e69de29..cbd48fa 100644 --- a/tp-cloud/ansible/gcp_compute.yml +++ b/tp-cloud/ansible/gcp_compute.yml @@ -0,0 +1,16 @@ +plugin: gcp_compute +zones: + - europe-west4-a +projects: + - tp-1-docker +service_account_file: ./service_account.json +auth_kind: serviceaccount +keyed_groups: + - key: labels + prefix: label + - key: zone + prefix: zone +hostnames: + - name +compose: + ansible_host: networkInterfaces[0].accessConfigs[0].natIP \ No newline at end of file diff --git a/tp-cloud/ansible/group_vars/all.yml b/tp-cloud/ansible/group_vars/all.yml index e69de29..b5d2865 100644 --- a/tp-cloud/ansible/group_vars/all.yml +++ b/tp-cloud/ansible/group_vars/all.yml @@ -0,0 +1,5 @@ +common_packages: + - vim + - curl + - htop + - net-tools diff --git a/tp-cloud/ansible/roles/common/tasks/main.yml b/tp-cloud/ansible/roles/common/tasks/main.yml new file mode 100644 index 0000000..1d62393 --- /dev/null +++ b/tp-cloud/ansible/roles/common/tasks/main.yml @@ -0,0 +1,20 @@ +- name: Install essential packages + ansible.builtin.yum: + name: + - vim + - curl + - htop + - net-tools + state: present + when: ansible_os_family == "RedHat" + +- name: Install essential packages on Debian/Ubuntu + ansible.builtin.apt: + name: + - vim + - curl + - htop + - net-tools + state: present + update_cache: yes + when: ansible_os_family == "Debian" diff --git a/tp-cloud/ansible/site.yml b/tp-cloud/ansible/site.yml index e69de29..756629e 100644 --- a/tp-cloud/ansible/site.yml +++ b/tp-cloud/ansible/site.yml @@ -0,0 +1,7 @@ +- name : Apply common config + hosts : all + become : yes + var_files : + - group_vars/all.yml + roles : + - common \ No newline at end of file