Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
22

When you put it this way, even if Ansible has some inherent advantages, the benefits of using familiar tools (in this case shell scripting) must be outweighed. I don't think there's a clear cut answer to that. If the team can achieve the things Ansible offers with shell: Declarative, idempotent configuration management Access to re-usable snippets (i.e. ...


22

I never used Ansible but since a few weeks, I try to figure out what good Ansible could be in comparison with shell scrips–Which proves, at least in my case, that the haunting ad-campaigns they run are effective! After many unsuccessful attempts–which proves how their documentation fail at answering one of the most obvious question–I think I finally got it: ...


11

The above answer covers part of it but misses one of the important elements: convergent design. I wrote some words a while ago about this in the context of Chef at https://coderanger.net/thinking/ but the short version is that a bash script is a set of instructions, while an Ansible playbook (or Chef recipe, Salt state, etc) is a description of desired state....


5

The only way to do it with cqlsh is wrap binary file into CSV file and run cqlsh --some_args -e 'COPY table_name FROM binary_wrapped.csv', but in order to do so you have to generate a new primary key to use in CSV-file. IMO: Since cqlsh is a wrapper around python client, your ops should just write simple python script for this operation, it would be much ...


4

The reason; having a more a version-agnostic and more backward-compatible directive in my server-environment-establishment script, to change the values of these two variables. If you're trying to configure a server, you should use a configuration management system (Ansible, Puppet, Chef, Salt) or bake images for immutable infrastructure; trying to hack ...


3

There is no "right" or "wrong". If the commands work when you type them in, then they work, and we won't keep you from doing it. Everything else is opinion. Sure, there are some best practices, for example some people find it unwise to directly fetch scripts from a public (3rd party) website and execute those locally without having a look inside first. It ...


3

One thing worth noting that you will have less issues in running your ansible playbooks on remote hosts too. As it's the main reason for running ansible. When you are using shell scripting you still need to have a way to script the scp'ing to the remote host.


2

Please provide more information about the method and the result as Husyn asked, it may be more suited to programming SO if it is PHP related. Anyway: <?php should be present at the start of any PHP script. If a PHP error occurs, you might not see it without error reporting enabled. If the actual shell command fails or outputs warnings, you won't see it ...


2

I found out how to do it without pipeline. It only has to do with command line script: start "" C:\MyApp\MyApp.exe >> text.txt This call is asynchronous (i.e., the command line won't wait for MyApp.exe to return). If you want it to wait, you can use the /w flag, like this: start /w "" C:\MyApp\MyApp.exe >> text.txt


2

PHP has supported conf.d configuration subdirectories for ages now (cf. PHP_INI_SCAN_DIR in its documentation, this stuff is as old as PHP 5 basically) - allowing you to simply add a small file containing just the snippet of config you need in there, and as long as you make sure it's named so that it's ordered in a way it overrides the defaults, you're done. ...


2

Well, to begin with, one of the key concepts behind the CaaS/PaaS/FaaS services is the offloading of the OS maintenance burden :) So it shouldn't even matter what version (or even what OS! - it could even be a proprietary one) the provider runs under the hood as long as the CaaS/PaaS/FaaS service performs according to the respective SLAs. Which is, in a way,...


1

If you are using Gitlab merely as a source code repository, and you are triggering the jobs when there are changes to the repository. The Jenkins Gitlab plugin documentations states: This plugin is a build trigger that allows GitLab to trigger Jenkins builds when code is pushed or a merge request is created. Configuration done on a per-job basis. So, ...


1

You can do this using perl For Example perl -pi -e "s/server.address=localhost/server.address=${SERVER_ADDRESS}/g" file_path This command change server address value localhost to vaariable value. Hope this works


1

Negation to the rescue: sed -i "s/server.address=[^\ ].*\ /server.address=${SERVER_ADDRESS} /g" This is telling to search zero or more characters (.*) NOT matching whitespace ([^\ ]) up to the first whitespace. A good pattern is not to use real values to be replaced (10.111.11.11:3197) but to use a mark like ###SERVER_ADDRESS###. If something goes wrong ...


1

You could extract the common, shareable portions of the scripts which you'd package as either standalone scripts or libraries (depending on the scripting language you use and/or preferences), placed in a shared location (of course, backed by their own repository). Then, in the scripts from your code repositories you'd replace the extracted portions with ...


1

You should regenerate this file from a template using your configuration management system of choice. You could also write a shell script that uses a heredoc to do the same thing. But since we're in DevOps-land you really should be using your configuration management system for these things.


1

You can use below. [user@xyz ~]$ hh='mysql.username=USERNAME';echo $hh | awk -F"=" '{OFS=FS}{ $2="Mango"; print }' mysql.username=Mango


1

You can obtain old parameters from the properties file before using sed, e.g. # get old parameters $ export oldUsername=$(grep mysql.username $FILE | cut -d'=' -f2) $ export oldPass=$(grep mysql.pass $FILE | cut -d'=' -f2) # set new parameters $ export newUsername=NEW_USERNAME $ export newPass=NEW_PASS # change parameters $ sed -i "s/$oldUsername/$...


1

I cannot say this is a the best answer so I do hope someone can provide a better clarification. It seems the default shell for sh() in Jenkins is Bourne. By updating the sh() with the correct shell this allows the below usage: sh'''#!/bin/bash IFS='/' branch=($1) # Use it. ''' This doesn't resolve the the redirection error. Also I would ...


1

Terraform is awesome for setting everything up. I like it less for the actual configuration. After Terraform runs and sets everyhting up (ec2 security groups/instances etc,.) we run Ansible to configure additional users. I recommend leaving AWS default user (ec2user, ubuntu) if you're using SSH Keys. Add to your 'authorized keys' all the public keys for ...


1

I found a way to set environmental variables globally from a file! I'm using envInject for loading variables from a file. For example, lets say I have a file that is called "versionNumber.txt" and that it's created during the build process. Maybe I update it in every build, or any other way. then I create a prosFile that can be identified by the envInject, ...


1

All this time after I think I am finally able to answer this question. The solution is Ansible - just like @James Shewey mentioned. It's agentless and quite light python framework, that can be made to work through jump hosts and perform automated tasks through SSH. This means it requires no server setup or manual operations of any kind from our customer to ...


1

Ok, let's assume you'll pull the latest version of branch prod from a git repo, here's what it would take with chef on a basic illustrative purpose: git "/opt/my_application" do source "https://<git_host>/<you_repo_url>/<repo.git>" revision "production" action :sync notifies :run,"execute[app_config]" end execute "app_config" do ...


1

Here are the resources which might be useful for . continuous integration Below . you might be visited but as novice . it will be easy to understand. jenkins:- https://www.tutorialspoint.com/jenkins/jenkins_git_setup.htm Shell Scripting :- I would . suggest . to start with basic unix commands like . cp,mv, file related and . permissions etc.. (Basic ...


Only top voted, non community-wiki answers of a minimum length are eligible