| --- |
| # ============LICENSE_START======================================================= |
| # Copyright (C) 2019 The Nordix Foundation. All rights reserved. |
| # ================================================================================ |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| # |
| # SPDX-License-Identifier: Apache-2.0 |
| # ============LICENSE_END========================================================= |
| |
| - name: Get IP of the jumphost from PDF |
| set_fact: |
| jumphost_ip: "{{ jumphost.interfaces[idf.net_config[engine.public_network | default('public')].interface].address }}" |
| delegate_to: localhost |
| |
| - name: Log jumphost IP to console |
| debug: |
| msg: "Jumphost IP is {{ jumphost_ip }}" |
| |
| - name: Update /etc/hosts with server FQDN |
| blockinfile: |
| path: /etc/hosts |
| block: | |
| {{ jumphost_ip }} {{ server_fqdn }} |
| marker: "# {mark} Ansible managed {{ server_fqdn }}" |
| |
| # NOTE (fdegir): apt sources.list is only updated for offline deployments |
| - name: Update /etc/apt/sources.list to use local apt repository |
| raw: echo "deb [trusted=yes] http://{{ server_fqdn }}/pkg amd64/" > /etc/apt/sources.list |
| args: |
| executable: /bin/bash |
| changed_when: true |
| become: true |
| when: execution_mode == "offline-deployment" |
| |
| # vim: set ts=2 sw=2 expandtab: |