Code Monkey home page Code Monkey logo

ansible-riak's People

Contributors

christophermancini avatar hbeatty avatar hectcastro avatar jaytaylor avatar lucafavatella avatar mbbroberg avatar ooshlablu avatar pmarques avatar swenson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-riak's Issues

README.md refers a missing `examples/` folder

I was looking for examples regarding the usage of this role to form a cluster and the documentation refers and links a missing examples/ folder, apparently deleted by cf5d68e. Because of the commit message I'm not sure if the deletion occurred by mistake, although I'm assuming they were deleted because they were out-of-date; what makes me question this is that they were already using v2.0.0 of riak-common: see roles.txt.

In the case of the latter, how different should the cluster setup be from the "old" examples? Are there plans to release some cluster setup examples any time soon?

Thanks in advance.

Debian doesn't support URL for package name.

When attempting to reference a URL or file on the remote machine for riak.deb, ansible gives this message:

TASK [ansible-riak : Install Riak for Debian] **********************************
fatal: [54.194.64.222]: FAILED! => {"changed": false, "failed": true, "msg": "No package matching 'http://s3.amazonaws.com/.../riak.deb' is available"}

It appears the cause of this is the fact that the apt module requires another parameter called deb when referencing local files. I'm not sure how to supply a URL at this point.

Local actions enforces sudo

In basho-labs.riak-kv/tasks/Debian.yml

- name: Fetch ansible ansible_version
  local_action: shell ansible --version
  register: ans_ver

Should be:

- name: Fetch ansible ansible_version
  local_action: shell ansible --version
  register: ans_ver
  sudo: False

Because it will trigger a local sudo that is not mandatory. As it is not mandatory, it should explicitely ignore rights escalation (see: ansible/ansible#1415 (comment) )

This is require for me since I moved from sudo to become/become_user

Using the a dependant package with ansible 2.0.1.0 and with_items

I have trouble making my riak role inherit this one with ansible 2.0.1.0. The with_items don't work very nice with BARE variables (eg not inside a "{{…}}") that cause my playbook to crash on security.yml and buckets.yml

Would it be possible to change security.yml to something like that:


---
- name: Create users
  command: '{{ riak_admin }} security add-user {{ item.user }} password={{ item.password }}'
  with_items: "{{riak_users}}"

- name: Create security sources
  command: '{{ riak_admin }} security add-source {{ item.user }} {{ item.cidr }} {{ item.type }}'
  with_items: "{{ riak_sources }}"

- name: Set security permissions
  command: '{{ riak_admin }} security grant {{ item.permissions }} on {{ item.container }} to {{ item.subject }}'
  with_items: "{{ riak_grants }}"

This to avoid this kin d of message:

[DEPRECATION WARNING]: Using bare variables is deprecated. Update your playbooks so that the environment value uses the full variable syntax ('{{riak_bucket_types}}'). This feature will be removed in a future release. Deprecation warnings can be disabled by
setting deprecation_warnings=False in ansible.cfg.

Role overwrites /etc/rc.local -- this is not good behaviour

If riak_tune_disks is enabled, then /etc/rc.local gets completely overwritten.

I don't think this is good behaviour at all -- sysadmins may have, quite reasonably, added customisations to this file already.

First suggestion

My suggestion would be to, instead, create an upstart job that starts on boot and runs once, which has the same content as the riak rc.local. That's unfortunately a bit distro-specific; you'd probably need to replicate this work for sysv and systemd as well. I'd say it's the right way to do this, though...

Alternative suggestion

Install an executable script somewhere with the actual content that current goes in rc.local. Then add a line to /etc/rc.local to call it. This can be done with the "lineinfile" command in Ansible, to just append the line to the file if it doesn't exist, rather than clobbering the whole file.

Thoughts?

Redundant riak.conf copy?

As new Riak KV versions are released, I am not confident of the files embedded in the role under directories files and templates. In particular, I understand the riak.conf file is already included in the packages hence, rather than embedding a Jinja2-templated-copy of that, Ansible modules e.g. lineinfile may be used for editing in-place /etc/riak/riak.conf. In this way, users wanting to perform custom changes to /etc/riak/riak.conf can do that knowing that as long as the line regexps are different ansible-riak will not overwrite those changes.

Do you understand as well that riak.conf.j2 could be deleted from the role replacing it with in-place editing where needed? And do you plan / accept contributions in this direction?

Unable to install through Galaxy

Hi,

In the « Ansible Galaxy Install » readme section, references are made to christophermancini.riak-kv which no longer exists.

There is no basho-labs or riak roles that matches this repository on Ansible Galaxy anymore.
I'll clone the repository, but I think that worth an action on your side.

Replace / add config settings by riak_conf dict fails if it is not defined

In the current dev-2.x branch, we have this action item:

- name: Replace / add config settings to riak.conf
  lineinfile: "dest=/etc/riak/riak.conf regexp='^#{0,1}{{ item.key|replace('-','.')  }} = .+$' line='{{ item.key|replace('-','.') }} = {{ item.value }}'"
  tags: configfiles
  when: riak_conf is defined
  with_dict: riak_conf

Unfortunately this fails with an error, "with_dict expects a dict", if riak_conf is undefined. Even though there is a conditional above that looks like it should prevent this item running at all.

(riak_conf can be optionally uncommented and defined in defaults/main.yml)

Note

The same issue applies to the security.yml tasks and their related (and commented-out) parameters in defaults.yml

Ansible role in ansible galaxy no longer works in Ubuntu Precise

Riak doesn't starts. Riak role version: v1.0.9. Riak common version: v1.1.0, Riak version 1.4

TASK: [basho.riak | start riak] ***********************************************
failed: [186.234.246.54] => {"failed": true}
msg: sudo: unable to resolve host riak-57ebaa2d-dd52-41cb-8bc4-6fe458c4a701
Error on line 18: syntax error before: '<'
Error reading /etc/riak/app.config

The app.config file in ansible-galaxy, differs from the one in github:

Ansible-galaxy:
{pb_backlog, (< riak_pb_backlog >)}

Github:
{pb, [ {"{{ riak_pb_bind_ip }}", {{ riak_pb_port }}} ]}
https://github.com/basho/ansible-riak/blob/develop/templates/etc_riak_app.config.j2

Version '1.4.10-1' for 'riak' was not found [JIRA: TOOLS-88]

I keep getting this when I use the role to install riak.

TASK: [basho.riak | install riak] ********************************************* 
failed: [crawler_stats] => {"failed": true}
stderr: E: Version '1.4.10-1' for 'riak' was not found

stdout: Reading package lists...
Building dependency tree...
Reading state information...

msg: 'apt-get install 'riak=1.4.10-1' ' failed: E: Version '1.4.10-1' for 'riak' was not found


FATAL: all hosts have already failed -- aborting

How can I use the role to install riak? I have this in my playbook. It is an ubuntu 14.04 box.

  - role: basho.riak
    tags: ["riak"]
    sudo: yes 

Ansible-riak seems to ignore mount point

Hi,
I'm trying to configure ansible-riak to use a separate volume for riak data. Although the ansible script correctly mounts the volume it seems to ignore it.

var.yml

riak_partition: '/dev/vdb'
riak_mountpoint: '/riak-data'
riak_tune_disks: yes
riak_physical_disks: '[vdb]'

df /riak-data
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/vdb 20642428 176064 19417788 1% /riak-data

df /var/lib/riak
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/vda1 41283904 1008184 38179116 3% /

May be the ansible script should change app.config data root to the mounted folder?

After a fresh install it points to:
{data_root, "/var/lib/riak/bitcask"}

Error deploying Riak KV with Ansible inventory having group named `riak`

Basically reopen of #79 but experienced by colleague with ansible 2.3.0.0
(and - if relevant at all - python version = 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]) that called host group riak. Changing variable riak_shell_group fixed this e.g. { role: ansible-riak, riak_shell_group: }.

Security is enabled by default

Security is enabled by default

I believe it started with this commit: 4464591

The tasks/security.yml is unconditionally included, and since the commit above includes enabling security.

I imagine the fix would be to only include tasks/security.yml if a 'security' option is enabled, but I'm not sure what the intention of the initial tasks/security.yml was.

Readme is incorrect regarding riak ansible module

The readme states that the riak ansible module is in extras so is not part of the core install. That is incorrect. A pip install, git install, or OS package install all currently provide the ansible-extras modules. I find it a bit odd that the examples here show how to use the riak command line tools in preference of the riak ansible module, but perhaps it's because of this misunderstanding.

Errors when no buckets are defined

To fix I moved the 'when: riak_bucket_types is defined' to main.yml. This seems to fix the issue and from what I can tell the buckets.yml should really only be called when there are buckets defined.

Search config

I propose defaults/main.yml shall have the possibility to express search config - similarly to how it already expresses bucket types (in riak_bucket_types) - with a section like this:

#riak_search_schemas:
#  - { name: myschema1, file: '/etc/mycustomschema' }
riak_search_schemas: []


#riak_search_indexes:
#  - { name: myidx1, schema: 'myschema1' }
#  - { name: myidx2, schema: 'myschema1' }
#  - { name: myidx3, schema: '_yz_default' }
riak_search_indexes: []

Q1. Would it fit in ansible-riak?

Q2. I understand it shall be implemented using PUT requests 1 and 2. Do you have any advice on how to invoke those PUT requests idempotently? The two PUT requests are documented to return 409 if same name is already present - but it would not check if attributes are the same of the request (i.e. if the schema content is the expected one, and if the index is using the correct schema). It would require caller to issue GET first, store body, compare with the expected one, and then err if found but different. But such logic looks complex. Would you accept ignore_errors: true like in 44da67f ?

Buckets/Security tasks fail on repeated runs

In dev-2.x branch, the buckets.yml and security.yml tasks will fail if re-run, throwing errors because the things they try to create have already been created.

Really they should have some kind of "only create if thing doesn't exist" logic added.

No packages found for Ubuntu 16.04 LTS (xenial)

Tried to use this role to install Riak TS on a couple of machines with Ubuntu 16.04 LTS installed and it failed as there is no packages in the repositories for this Ubuntu version. This might not be the correct place to report this, but I really don't know where.

TASK [basho-labs.riak-kv : Install Pre-requisites] *****************************
ok: [192.168.11.100] => (item=[u'curl', u'apt-transport-https', u'default-jre'])
ok: [192.168.12.9] => (item=[u'curl', u'apt-transport-https', u'default-jre'])
ok: [192.168.13.124] => (item=[u'curl', u'apt-transport-https', u'default-jre'])

TASK [basho-labs.riak-kv : Check if Riak is installed] *************************
ok: [192.168.11.100]
ok: [192.168.13.124]
ok: [192.168.12.9]

TASK [basho-labs.riak-kv : Add Package Cloud repository key without validation] 
ok: [192.168.11.100]
ok: [192.168.12.9]
ok: [192.168.13.124]

TASK [basho-labs.riak-kv : Add Basho Riak repository (hosted at Package Cloud)] 
ok: [192.168.11.100]
ok: [192.168.13.124]
ok: [192.168.12.9]

TASK [basho-labs.riak-kv : Install Riak for Debian] ****************************
fatal: [192.168.13.124]: FAILED! => {"changed": false, "failed": true, "msg": "No package matching 'riak-ts' is available"}
fatal: [192.168.12.9]: FAILED! => {"changed": false, "failed": true, "msg": "No package matching 'riak-ts' is available"}
fatal: [192.168.11.100]: FAILED! => {"changed": false, "failed": true, "msg": "No package matching 'riak-ts' is available"}
	to retry, use: --limit @/home/ubuntu/ansible/riakts_nodes.retry

PLAY RECAP *********************************************************************

Error deploying Riak KV with Ansible 2.2.2.0 inventory having group named `riak`

ansible-riak defaults riak_shell_group to 'riak'. Apparently Ansible 2.2.2.0 changed somehow evaluation of conditionals and/or dict lookup compared to 2.2.1.0 - see #78. Therefore users with an Ansible inventory with a host group named riak experiences error in dict lookup.

Workaround as a user is changing default riak_shell_group when using ansible-riak e.g. { role: ansible-riak, riak_shell_group: }.

Proper fix would either:

  • Investigate Ansible semantics and review riak_shell_nodes and dependent variables; or
  • Conditionally default riak_shell_group to 'riak' only if riak ts is being installed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.