Skip to content

Commit

Permalink
Nomad v0.8.6 and more
Browse files Browse the repository at this point in the history
- Nomad v0.8.6
- Consistent boolean usage
- Improve Consul bootstrapping (thanks @RodolpheFouquet)
- Systemd daemon reload (thanks @mrvovanness)
- Advertise ports (thanks @Tsuki)
- Update CONTRIBUTORS
  • Loading branch information
brianshumate committed Oct 10, 2018
1 parent 25ab2f2 commit f3b4309
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 35 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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`

Expand Down
34 changes: 17 additions & 17 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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) %}\
Expand All @@ -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"
Expand All @@ -121,20 +121,20 @@ 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: ""
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: ""
Expand Down
4 changes: 2 additions & 2 deletions tasks/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
apt:
pkg: dmsetup
state: installed
update_cache: yes
update_cache: true
cache_valid_time: 600
register: dmsetup_result
when:
Expand All @@ -26,4 +26,4 @@
user:
name: "{{ nomad_user }}"
groups: docker
append: yes
append: true
16 changes: 8 additions & 8 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -64,5 +64,5 @@

- name: Cleanup
local_action: file path="{{ install_temp.path }}" state="absent"
become: no
become: false
tags: installation
6 changes: 3 additions & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -136,5 +136,5 @@
- name: Start Nomad
service:
name: nomad
enabled: yes
enabled: true
state: started
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.7.9
v1.8.0

0 comments on commit f3b4309

Please sign in to comment.