From f3b43092526671cb1373dae7cdbbc004ccd4e559 Mon Sep 17 00:00:00 2001 From: Brian Shumate Date: Wed, 10 Oct 2018 14:12:31 -0400 Subject: [PATCH] Nomad v0.8.6 and more - Nomad v0.8.6 - Consistent boolean usage - Improve Consul bootstrapping (thanks @RodolpheFouquet) - Systemd daemon reload (thanks @mrvovanness) - Advertise ports (thanks @Tsuki) - Update CONTRIBUTORS --- CHANGELOG.md | 5 ++++- CONTRIBUTORS.md | 1 + README.md | 6 +++--- defaults/main.yml | 34 +++++++++++++++++----------------- tasks/docker.yml | 4 ++-- tasks/install.yml | 16 ++++++++-------- tasks/main.yml | 6 +++--- version.txt | 2 +- 8 files changed, 39 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a29e38af..7d0c6ee9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,10 @@ -## v1.8.0 (UNRELEASED) +## v1.8.0 +- Nomad v0.8.6 +- Consistent boolean usage - Improve Consul bootstrapping (thanks @RodolpheFouquet) - Systemd daemon reload (thanks @mrvovanness) +- Advertise ports (thanks @Tsuki) - Update CONTRIBUTORS ## v1.7.9 diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 6999463f..9e70d1e6 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -13,3 +13,4 @@ Thank you to all these fine folk for helping with ansible-nomad! - [@ccf](https://github.com/ccf) - [@RodolpheFouquet](https://github.com/RodolpheFouquet) - [@mrvovanness](https://github.com/mrvovanness) +- [@Tsuki]https://github.com/Tsuki diff --git a/README.md b/README.md index 71a87eb4..1a1922cc 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,8 @@ in a development environment based on Vagrant and VirtualBox. See This role requires a Debian, RHEL, or Ubuntu distribution; the role is tested with the following specific software versions: -* Ansible: 2.6.0 -* nomad: 0.8.4 +* Ansible: 2.6.4 +* nomad: 0.8.6 * CentOS: 7 * Debian: 8 * RHEL: 7 @@ -35,7 +35,7 @@ The role defines most of its variables in `defaults/main.yml`: ### `nomad_version` - Nomad version to install -- Default value: **0.8.3** +- Default value: **0.8.6** ### `nomad_architecture_map` diff --git a/defaults/main.yml b/defaults/main.yml index 4a9a5dd4..ef4847ce 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -2,10 +2,10 @@ # File: main.yml - Main default variables for nomad ## Core -nomad_debug: no +nomad_debug: false ### Package -nomad_version: "{{ lookup('env','NOMAD_VERSION') | default('0.8.4', true) }}" +nomad_version: "{{ lookup('env','NOMAD_VERSION') | default('0.8.6', true) }}" nomad_architecture_map: amd64: amd64 x86_64: amd64 @@ -27,28 +27,28 @@ nomad_log_dir: "/var/log/nomad" nomad_run_dir: "/var/run/nomad" ### System user and group -nomad_manage_user: yes +nomad_manage_user: true nomad_user: "root" -nomad_manage_group: no +nomad_manage_group: false nomad_group: "bin" ### Nomad settings nomad_datacenter: "dc1" nomad_region: "global" nomad_log_level: "INFO" -nomad_syslog_enable: yes +nomad_syslog_enable: true nomad_iface: "{{ lookup('env','NOMAD_IFACE') | default(ansible_default_ipv4.interface, true) }}" nomad_node_name: "{{ inventory_hostname_short }}" nomad_node_role: "{{ lookup('env','NOMAD_NODE_ROLE') | default('client', true) }}" -nomad_leave_on_terminate: yes -nomad_leave_on_interrupt: no -nomad_disable_update_check: no +nomad_leave_on_terminate: true +nomad_leave_on_interrupt: false +nomad_disable_update_check: false #### Server settings nomad_retry_max: 0 -nomad_retry_join: no +nomad_retry_join: false nomad_retry_interval: "30s" -nomad_rejoin_after_leave: no +nomad_rejoin_after_leave: false nomad_enabled_schedulers: - service - batch @@ -61,7 +61,7 @@ nomad_encrypt: "" #### Client settings nomad_node_class: "" -nomad_no_host_uuid: no +nomad_no_host_uuid: false nomad_max_kill_timeout: "30s" nomad_network_speed: 0 nomad_cpu_total_compute: 0 @@ -91,7 +91,7 @@ nomad_ports: ### Servers nomad_group_name: "nomad_instances" nomad_servers: "\ - {% if nomad_use_consul==False %}\ + {% if nomad_use_consul==false %}\ {% set _nomad_servers = [] %}\ {% for host in groups[nomad_group_name] %}\ {% set _nomad_node_role = hostvars[host]['nomad_node_role'] | default('client', true) %}\ @@ -103,10 +103,10 @@ nomad_servers: "\ {% else %}\ []\ {% endif %}" -nomad_gather_server_facts: no +nomad_gather_server_facts: false ### Consul -nomad_use_consul: False +nomad_use_consul: false nomad_consul_address: "localhost:8500" nomad_consul_servers_service_name: "nomad-servers" nomad_consul_clients_service_name: "nomad-clients" @@ -121,7 +121,7 @@ nomad_acl_replication_token: "" ### Vault nomad_vault_enabled: "{{ lookup('env', 'NOMAD_VAULT_ENABLED') | default('no', true) }}" nomad_vault_address: "{{ vault_address | default('0.0.0.0', true) }}" -nomad_vault_allow_unauthenticated: yes +nomad_vault_allow_unauthenticated: true nomad_vault_create_from_role: "" nomad_vault_task_token_ttl: "" nomad_vault_ca_file: "" @@ -129,12 +129,12 @@ nomad_vault_ca_path: "" nomad_vault_cert_file: "" nomad_vault_key_file: "" nomad_vault_tls_server_name: "" -nomad_vault_tls_skip_verify: no +nomad_vault_tls_skip_verify: false nomad_vault_token: "" ### Docker nomad_docker_enable: "{{ lookup('env','NOMAD_DOCKER_ENABLE') | default('false', true) }}" -nomad_docker_dmsetup: yes +nomad_docker_dmsetup: true ### Tls nomad_ca_file: "" diff --git a/tasks/docker.yml b/tasks/docker.yml index eec5ec4d..e4541b4b 100644 --- a/tasks/docker.yml +++ b/tasks/docker.yml @@ -8,7 +8,7 @@ apt: pkg: dmsetup state: installed - update_cache: yes + update_cache: true cache_valid_time: 600 register: dmsetup_result when: @@ -26,4 +26,4 @@ user: name: "{{ nomad_user }}" groups: docker - append: yes + append: true diff --git a/tasks/install.yml b/tasks/install.yml index c8c1e269..6851d85f 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -10,32 +10,32 @@ - name: Check Nomad package checksum file local_action: stat path="{{ role_path }}/files/nomad_{{ nomad_version }}_SHA256SUMS" - become: no + become: false run_once: true tags: installation register: nomad_checksum - name: Get Nomad package checksum file local_action: get_url url="{{ nomad_checksum_file_url }}" dest="{{ role_path }}/files/nomad_{{ nomad_version }}_SHA256SUMS" - become: no + become: false run_once: true tags: installation when: nomad_checksum.stat.exists == False - name: Get Nomad package checksum local_action: shell grep "{{ nomad_pkg }}" "{{ role_path }}/files/nomad_{{ nomad_version }}_SHA256SUMS" | awk '{print $1}' - become: no + become: false register: nomad_sha256 tags: installation - name: Check Nomad package file local_action: stat path="{{ role_path }}/files/{{ nomad_pkg }}" - become: no + become: false register: nomad_package - name: Download Nomad local_action: get_url url="{{ nomad_zip_url }}" dest="{{ role_path }}/files/{{ nomad_pkg }}" checksum="sha256:{{ nomad_sha256.stdout }}" timeout="42" - become: no + become: false tags: installation when: nomad_package.stat.exists == False @@ -44,13 +44,13 @@ module: tempfile state: directory prefix: ansible-nomad. - become: no + become: false register: install_temp tags: installation - name: Unarchive Nomad local_action: unarchive src="{{ role_path }}/files/{{ nomad_pkg }}" dest="{{ install_temp.path }}/" creates="{{ install_temp.path }}/nomad" - become: no + become: false tags: installation - name: Install Nomad @@ -64,5 +64,5 @@ - name: Cleanup local_action: file path="{{ install_temp.path }}" state="absent" - become: no + become: false tags: installation diff --git a/tasks/main.yml b/tasks/main.yml index 9b5d858b..3014bfb7 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -13,9 +13,9 @@ - name: Gather facts from other servers setup: delegate_to: "{{ item }}" - delegate_facts: True + delegate_facts: true with_items: "{{ nomad_servers | difference(play_hosts) }}" - ignore_errors: yes + ignore_errors: true when: nomad_gather_server_facts | bool - name: Expose bind_address, advertise_address and node_role as facts @@ -136,5 +136,5 @@ - name: Start Nomad service: name: nomad - enabled: yes + enabled: true state: started diff --git a/version.txt b/version.txt index 01990b44..4e2cea3b 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v1.7.9 \ No newline at end of file +v1.8.0 \ No newline at end of file