unarchive not working on fbsd

This commit is contained in:
Amarpreet Minhas 2020-08-20 01:11:33 -04:00
parent f2cd627f30
commit dcc0291ddb
10 changed files with 55 additions and 14 deletions

View file

@ -1,16 +1,18 @@
# config file for ansible -- Asara
# ===============================================
[defaults]
inventory = inventory/hosts
inventory = inventory.txt
remote_tmp = ~/.ansible/tmp
local_tmp = ~/.ansible/tmp
group_vars = ./group_vars
roles_path = ./roles
interpreter_python = python3
forks = 5
poll_interval = 15
transport = smart
remote_port = 22
gathering = smart
roles_path = ./roles
stdout_callback = skippy
callback_whitelist = timer
timeout = 10

View file

@ -6,8 +6,4 @@
- hosts: consul_server
roles:
- role: consul_server
- hosts: all:!consul_server
roles:
- role: consul
...

8
ansible/requirements.txt Normal file
View file

@ -0,0 +1,8 @@
ansible==2.9.12
cffi==1.14.2
cryptography==3.0
Jinja2==2.11.2
MarkupSafe==1.1.1
pycparser==2.20
PyYAML==5.3.1
six==1.15.0

View file

@ -1,11 +1,11 @@
---
- name: apt update
apt:
update_cache: true
update_cache: True
- name: apt upgrade
apt:
upgrade: yes
upgrade: "yes"
- name: apt dist-upgrade
apt:
@ -27,9 +27,9 @@
- tmux
- tree
- vim
state: installed
state: present
- name: apt autoremove
apt:
autoremove: true
autoremove: True
...

View file

@ -6,6 +6,7 @@
packages:
- htop
- git
- gtar
- ncdu
- ntp
- screen

View file

@ -1,3 +1,3 @@
---
- include: "{{ ansible_os_family }}"
- include: "{{ ansible_os_family }}.yml"
...

View file

@ -1,6 +1,18 @@
---
- name: check consul version
shell:
cmd: "consul --version | head -1 | cut -d'v' -f2"
args:
executable: /bin/bash
changed_when: False
register: installed_consul_version
- name: get consul
unarchive:
src: "https://releases.hashicorp.com/consul/{{ consul_version }}/consul_{{ consul_version }}_linux_amd64.zip"
dest: /usr/local/bin/
mode: 0755
owner: root
group: root
remote_src: yes
when: installed_consul_version.stdout != consul_version

View file

@ -1,4 +1,26 @@
---
- name: check consul version
shell:
cmd: "consul --version | head -1 | cut -d'v' -f2"
args:
executable: /bin/bash
changed_when: False
failed_when: False
register: installed_consul_version
- name: get consul
get_url:
url: "https://releases.hashicorp.com/consul/{{ consul_version }}/consul_{{ consul_version }}_freebsd_amd64.zip"
dest: /tmp/consul.zip
when: ("No such file" not in installed_consul_version.msg) or (installed_consul_version.msg != consul_version)
register: get_consul
- name: get consul
unarchive:
src: "https://releases.hashicorp.com/consul/{{ consul_version }}/consul_{{ consul_version }}_linux_amd64.zip"
src: /tmp/consul.zip
dest: /usr/local/bin/
remote_src: True
mode: 0755
owner: root
group: root
when: get_consul.changed

View file

@ -1,3 +1,3 @@
---
- include: "{{ ansible_os_family }}"
- include: "{{ ansible_os_family }}.yml"
...