我总是想知道shell使用"ansible方式"(用get_url等等)替换以下任务的好方法是什么:
- name: Install oh-my-zsh
shell: wget -qO - https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | bash -
Run Code Online (Sandbox Code Playgroud)
要么
- name: Install nodesource repo
shell: curl -sL https://deb.nodesource.com/setup_5.x | bash -
Run Code Online (Sandbox Code Playgroud) 我只是想知道,在我的NodeJS流程开始时,是否启动了Redis(因此用户会话将被存储或不存储).
这就是我现在所拥有的:
var session = require('express-session');
var RedisStore = require('connect-redis')(session);
var redis = require("redis");
var client = redis.createClient(global.redis.host, global.redis.port);
// Check if redis is running
var redisIsReady = false;
client.on('error', function(err) {
redisIsReady = false;
console.log('redis is not running');
console.log(err);
});
client.on('ready', function() {
redisIsReady = true;
console.log('redis is running');
});
// Here I use express-session, but I want to set a store only if redis is ready
sessOptions = {
[...]
}
// Store setting
if (redisIsReady) {
sessOptions.store …Run Code Online (Sandbox Code Playgroud) 我正在使用分享链接Google+: https://plus.google.com/share?hl=fr&url=http%3A%2F%2Fmywebsite.com%2F
我想知道为什么我的描述标签没有显示在共享窗口上.我只看到图像,标题,URL但我找不到任何描述.
<meta content="website" property="og:type">
<meta content="Something great" property="og:title">
<meta content="http://mywebsite.com/" property="og:url">
<meta content="My description blaah." property="og:description">
<meta content="http://mywebsite.com/img/partage.png" property="og:image">
<meta content="Something great" itemprop="name">
<meta content="My description blaah." itemprop="description">
<meta content="http://mywebsite.com/img/partage.png" itemprop="image">
Run Code Online (Sandbox Code Playgroud)