diff --git a/inventory.yaml b/inventory.yaml index 3f31df3..47a45c1 100644 --- a/inventory.yaml +++ b/inventory.yaml @@ -24,8 +24,6 @@ en1: ansible_host: 10.42.101.200 skylab_description: Local Monitor Node skylab_targets: [network] - skylab_roles: - - server children: @@ -33,10 +31,6 @@ en1: vars: skylab_targets: [cluster, datastore] skylab_compose_version: 3.8 - skylab_roles: - - server - - datastore - - swarm hosts: pegasus: # jupiter @@ -158,4 +152,3 @@ en2: skylab_hostname: hubble.en2.enp.one skylab_description: Cloud Web Server skylab_targets: [cloud] - skylab_roles: [server] diff --git a/playbooks/configure.yaml b/playbooks/configure.yaml index 51e309c..75824c7 100644 --- a/playbooks/configure.yaml +++ b/playbooks/configure.yaml @@ -16,13 +16,17 @@ - include_tasks: tasks/meta/bootstrap-remote-env.yaml -- name: Configure hosts by role - hosts: linux +# "server", here, is a word used to mean "not a workstation" +- name: Configure servers + hosts: linux:!workstation gather_facts: false roles: - role: server - when: "'server' in skylab_roles | default([])" + + +- name: Configure cluster + hosts: linux:&cluster + gather_facts: false + roles: - role: datastore - when: "'datastore' in skylab_roles | default([])" - role: swarm - when: "'swarm' in skylab_roles | default([])" diff --git a/playbooks/node-up.yaml b/playbooks/node-up.yaml index a10cee6..517960c 100644 --- a/playbooks/node-up.yaml +++ b/playbooks/node-up.yaml @@ -7,7 +7,6 @@ private: true roles: - role: datastore - when: "'datastore' in skylab_roles | default([])" tasks: - name: Fetch node swarm ID ansible.builtin.command: diff --git a/roles/swarm/tasks/gluster.yaml b/roles/swarm/tasks/gluster.yaml index 8a43de4..83e9232 100644 --- a/roles/swarm/tasks/gluster.yaml +++ b/roles/swarm/tasks/gluster.yaml @@ -31,7 +31,6 @@ - name: Determine gluster servers run_once: true - when: "'datastore' in hostvars[item].skylab_roles | default([])" vars: _docker_glusterfs_hostnames: [] ansible.builtin.set_fact: