]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
gateway: Support writing addl routes 620/head
authorDavid Galloway <dgallowa@redhat.com>
Tue, 11 May 2021 16:53:11 +0000 (12:53 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Tue, 11 May 2021 16:54:30 +0000 (12:54 -0400)
Signed-off-by: David Galloway <dgallowa@redhat.com>
roles/gateway/README.rst
roles/gateway/tasks/network.yml

index 565cae3666c30d2d6ad71641bdc137cf4550abed..5cea2e12d821b858e859e70622efe4edafd4a1df 100644 (file)
@@ -78,8 +78,8 @@ VLAN in your lab.  The subelements ``peerdns`` and ``dns{1,2}`` are optional for
 all but one NIC.  These are what set your nameservers in
 ``/etc/resolv.conf``.
 ``dns1`` and ``dns2`` should be defined under a single NIC and ``peerdns``
-should be set to ``"yes"``.  Defined in the
-secrets repo::
+should be set to ``"yes"``.  ``routes`` is optional but must be formatted as documented in RHEL_ documentation.
+Defined in the secrets repo::
 
     # Example:
     gw_networks:
@@ -94,6 +94,13 @@ secrets repo::
         search "private.example.com"
         dns1: "192.168.1.1"
         dns2: "8.8.8.8"
+        routes: |
+          ADDRESS0=192.168.1.0
+          NETMASK0=255.255.240.0
+          GATEWAY0=192.168.1.1
+          ADDRESS1=172.21.64.0
+          NETMASK1=255.255.252.0
+          GATEWAY1=192.168.1.1
       public:
         ifname: "eth1"
         etc...
@@ -154,3 +161,4 @@ To Do
 - Generate and pull (to secrets?) CA, keys, and certificates
 
 .. _Sepia: https://ceph.github.io/sepia/
+.. _RHEL: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec-Configuring_Static_Routes_in_ifcfg_files#bh-Static_Routes_Using_the_Network-Netmask_Directives_Format
index 3c80efcb95c23d09ac8a83df685d4284ad124b8e..b61c8d194b0ef09a21ff3e9eec57512ee5915553 100644 (file)
@@ -6,6 +6,13 @@
   with_dict: "{{ gw_networks }}"
   register: interfaces
 
+- name: Write additional routes
+  copy:
+    content: "{{ item.value.routes }}"
+    dest: "/etc/sysconfig/network-scripts/route-{{ item.value.ifname }}"
+  with_dict: "{{ gw_networks }}"
+  when: item.value.routes is defined
+
 # Restart networking right away if changes made.  This makes sure
 # the public interface is up and ready for OpenVPN to bind to.
 - name: Restart networking