diff --git a/inventory.sample b/inventory.sample index 1190cb679ed78e7156770cf3f0839ca921bd61bc..90d3de688505c296789e077f89af6de8f5ea6d79 100644 --- a/inventory.sample +++ b/inventory.sample @@ -2,6 +2,12 @@ 192.168.1.1 192.168.1.11 +[gnome] +192.168.1.11 + +[mate] +192.168.1.2 + [virtual] 192.168.1.2 192.168.1.22 @@ -10,11 +16,19 @@ 192.168.1.1 192.168.1.2 -[workstation] +[localdev] +192.168.1.11 + +[station] localhost 192.168.1.11 192.168.1.22 +[workstation:children] +gnome +mate +localdev + [server:vars] timezone="UTC" diff --git a/tasks/become_user_cfg.yml b/tasks/become_user_cfg.yml index aee552ec320d3127a6fcf59009acd7ccf00c452b..960cfceb4396e140d13fd6f9cebabc1fe7aa0eb2 100644 --- a/tasks/become_user_cfg.yml +++ b/tasks/become_user_cfg.yml @@ -1,7 +1,9 @@ --- +# When 1st user is root, set it as "remote_user" and remove all "become: yes" - hosts: "{{ host_list }}" become_method: sudo remote_user: "{{ my_user }}" + #remote_user: root tasks: - name: SUDO | Group sudo presence diff --git a/tasks/user_cfg/my_user.yml b/tasks/user_cfg/my_user.yml index 3e0354b5cc6363f74697e1aeebd5a3ec4b722426..5868568104701476dd4e40c65de2f89743a31c72 100644 --- a/tasks/user_cfg/my_user.yml +++ b/tasks/user_cfg/my_user.yml @@ -31,12 +31,12 @@ state: directory - name: INCLUDE_VARS | git - when: inventory_hostname in groups.station + when: inventory_hostname in groups.localdev ansible.builtin.include_vars: "vars/git.yml" - name: MY USER | clone git repos become: yes - when: inventory_hostname in groups.station + when: inventory_hostname in groups.localdev ansible.builtin.git: dest: "/home/{{ my_user }}/git/{{ item.local_name }}" repo: "{{ item.url_https }}" diff --git a/tasks/user_cfg/vars/git.yml b/tasks/user_cfg/vars/git.yml index b87733892e7e912032283951bb51da92b4cc27a7..1a744a9e387237bdb8bbacfeb196b1209e31e076 100644 --- a/tasks/user_cfg/vars/git.yml +++ b/tasks/user_cfg/vars/git.yml @@ -1,13 +1,11 @@ --- git_repositories: - - {local_name: "afpy19", url_https: "https://gitlab.com/free_zed/afpy19.git"} - {local_name: "askthom", url_https: "https://lab.frogg.it/fcode/askthom.git"} - {local_name: "djlease", url_https: "https://gitlab.com/free_zed/djlease.git"} - {local_name: "eb-car", url_https: "https://gitlab.com/combien-de-temps-pour-faire-sonner-la-cloche-a-aiguebelle/combien-de-temps-pour-faire-sonner-la-cloche-a-aiguebelle.gitlab.io.git"} - - {local_name: "exchange", url_https: "https://gitlab.com/free_zed/mymsesb.git"} - {local_name: "forga-a14n", url_https: "https://gitlab.com/free_zed/djbp.git"} - {local_name: "forga-core", url_https: "https://gitlab.com/forga/tool/django/core.git"} - - {local_name: "forga-dev-bpy", url_https: "https://gitlab.com/forga/devel/boilerplate/python.git"} + - {local_name: "forga-dev-bpy", url_https: "https://git.afpy.org/fcode/boilerplate-python.git"} - {local_name: "forga-emb", url_https: "https://gitlab.com/forga/process/fr/embarquement.git"} - {local_name: "forga-glio", url_https: "https://gitlab.com/forga/forga.gitlab.io.git"} - {local_name: "forga-man", url_https: "https://gitlab.com/forga/process/fr/manuel.git"} @@ -18,7 +16,7 @@ git_repositories: - {local_name: "gpxpy", url_https: "https://github.com/freezed/gpxpy.git"} - {local_name: "grandpy", url_https: "https://github.com/freezed/ocp7.git"} - {local_name: "hellozappa", url_https: "https://gitlab.com/free_zed/hellozappa.git"} - - {local_name: "men-rt-ocp08", url_https: "https://github.com/remace/OC-P8-Purbeurre.git"} + - {local_name: "ldpy", url_https: "https://git.afpy.org/fcode/ldpy.git.git"} - {local_name: "mountaingpx", url_https: "https://github.com/krisanselmo/mountaingpx.git"} - {local_name: "myasb", url_https: "https://gitlab.com/forga/tool/ansible/debian.git"} - {local_name: "mypsb", url_https: "https://gitlab.com/free_zed/mypsb.git"}