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 # config file for ansible -- Asara
# =============================================== # ===============================================
[defaults] [defaults]
inventory = inventory.txt
inventory = inventory/hosts
remote_tmp = ~/.ansible/tmp remote_tmp = ~/.ansible/tmp
local_tmp = ~/.ansible/tmp local_tmp = ~/.ansible/tmp
group_vars = ./group_vars
roles_path = ./roles
interpreter_python = python3
forks = 5 forks = 5
poll_interval = 15 poll_interval = 15
transport = smart transport = smart
remote_port = 22 remote_port = 22
gathering = smart gathering = smart
roles_path = ./roles
stdout_callback = skippy stdout_callback = skippy
callback_whitelist = timer callback_whitelist = timer
timeout = 10 timeout = 10

View file

@ -6,8 +6,4 @@
- hosts: consul_server - hosts: consul_server
roles: roles:
- role: consul_server - 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 - name: apt update
apt: apt:
update_cache: true update_cache: True
- name: apt upgrade - name: apt upgrade
apt: apt:
upgrade: yes upgrade: "yes"
- name: apt dist-upgrade - name: apt dist-upgrade
apt: apt:
@ -27,9 +27,9 @@
- tmux - tmux
- tree - tree
- vim - vim
state: installed state: present
- name: apt autoremove - name: apt autoremove
apt: apt:
autoremove: true autoremove: True
... ...

View file

@ -6,6 +6,7 @@
packages: packages:
- htop - htop
- git - git
- gtar
- ncdu - ncdu
- ntp - ntp
- screen - 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 - name: get consul
unarchive: unarchive:
src: "https://releases.hashicorp.com/consul/{{ consul_version }}/consul_{{ consul_version }}_linux_amd64.zip" src: "https://releases.hashicorp.com/consul/{{ consul_version }}/consul_{{ consul_version }}_linux_amd64.zip"
dest: /usr/local/bin/ dest: /usr/local/bin/
mode: 0755
owner: root
group: root
remote_src: yes 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 - name: get consul
unarchive: 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"
... ...